Event That Fires Only When User Moves The Splitter?

Jul 7, 2010

I have a VB .NET form with a splitter control on it, and I want to save its position between program runs. I am currently handling the SplitterMoved event and storing the SplitterDistance. Then on program startup, I set the SplitterDistance to the saved value.

However, sometimes the program resizes the splitter, raising the SplitterMoved event and overwriting my saved distance. I have several splitters over multiple tabs in a tab control, and any time the user goes to a new tab for the first time, the SplitterMoved event fires.Is there an event I can use that will only fire when the user moves the splitter, and not when the program moves the splitter? I tried MouseUp, but when that event fires, the new SplitterDistance is not yet set.

View 2 Replies


ADVERTISEMENT

Cancel Fires But Other Code Also Fires When A Click Event Occurs?

Mar 9, 2012

A form has many buttons. One of those buttons contains code to update the TableAdapterManager. One of the many TextBox controls has code in a Validating event handler. There is code to make sure a US phone number is formatted properly.If the user tabs out of the TextBox the Validating code works perfectly and show a message to the user if the phone number is not properly formatted and the focus is place in the offending TextBox.If the user clicks on a button that has code to update the TableAdapterManager the Validating code fires but instead of focus remaining on the offending TextBox, the code in the button Click handler also fires.

I would like to stop the button code from firing.Here is the code for the Validating event of the TextBox:

Private Sub TextBoxPrimaryPhone_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TextBoxPrimaryPhone.Validating
' Make sure the phone is formatted correctly.

[code]....

What additional coding to I need to include so focus remains on the TextBox?

View 1 Replies

C# - ListView ItemActivate Delay Between When The User Clicks The Item And The Event Fires

May 12, 2009

I have a ListView with the Activation property with HotTracking. There appears to be about a 2 second delay between when the user clicks the item and the event fires. Is there a way to get the event to fire immediately upon the user click?

View 2 Replies

User Interface - THE "_Fault_StateChanged" Event Never Fires?

Dec 22, 2009

I have a feature whereby a class in a dll displays a form asking a user to clear a fault on a printer before clicking a button to say "Retry".The users have been just hitting retry without bothering to clear the fault so I am now coding an interlock:The button on the invoked form is disabled until a call is made to an 'enable' method on the form.

This is done with delegate invocation as the events triggering these changes come from other dlls running on different threads.The form's 'enable' method is wired into an EVENT HANDLER handling an event coming in from a different thread (one that monitors an ethernet IO Server).The problem I have is that THE "_Fault_StateChanged" EVENT NEVER FIRES. I suspected the cause was the "ShowDialog" and "DialogResult" technique I have used here, but I have used this exact same technique elsewhere in this application.[code]....

View 1 Replies

Event In The DS That Fires When Data Changes?

Oct 13, 2010

I read data into a DS from an XML file. The user has the ability to "Save" or "Save As" at any time. They can also "Open" an existing file or create a "New" one. (brilliant, don't you think?)

I need to make sure I ask the user if they want to save their existing data (i.e. rewrite the XML file) if the DS has changed from the XML load or from the last time they Saved. On Open, New or exit I have been checking the HasChanges function on the DS. This doesn't work the way that I need. I use AcceptChanges throughout the program to commit values to the DS. This appears to kill the HasChanges even though the DS is now different than the XML file.

Is there an event in the DS that fires when data changes? If so, I believe I can set a flag that can be checked later. If not, is there any other way to track that a DS has changed after the initial XML load? Would reloading the XML into a cloned DS and comparing the two work? Seems like a waste of "time", especially with large XML files, but if it's the only way.

View 5 Replies

PropertyChanged Event Fires Twice And Should Not

Mar 14, 2011

I have a class with two descendent classes (child, grandchild):[code]When a property changes in the Measurement class I raise a OnCrucibleOxidizedMassChanged event:[code]However, the OnChanged sub gets called twice, even though I only assign a value to CrucibleOxidizedMass once.

View 1 Replies

Select Twice Before Event Fires?

Jul 17, 2009

I have a problem with a ComboBox to select FontStyle. I need to select the font style twice to fire the event in SelectedIndexChanged Event, that means for example to click "Arial Black" twice to set the text to this font.

View 1 Replies

Event That Fires After Form.Load?

May 12, 2010

I'm looking for an event on a form that fires after Form.Load. Specifically, after the form has been displayed. Is there one?

View 3 Replies

Serialport DataReceived Event Never Fires

Apr 2, 2009

When I write a byte array to a device using this code, the DataReceived Event never fires.....

[Code]...

AND if the sleep is <40, the event doesn't fire. Is this necessary or am I overlooking something?

View 11 Replies

Event Fires When Bound Controls Are Refreshed?

Feb 27, 2012

what event fires when individual textboxes that are bound to a data source using the properties pane gets refreshed? I wish to use this event to populate a few textboxes that are not bound.

View 1 Replies

IDE :: Windows Forms Control Leave Event Fires More Than Once?

Jul 11, 2009

The leave event fires twice in this example. Tab order for the form controls is set to combobox1, button1, button3 Private Sub ComboBox1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.Leave

[Code]...

if I enter 'A' in the combobox1 then combobox1 leave event will fire twice any other entry is Ok since the next control to get focus is button2 (in the normal tab order).It seems that if I try to skip the next control (based on the tab order set for the form), the leave event fires twice.

View 2 Replies

.net - Form Load Event Fires Twice Using Interop Forms Toolkit?

Sep 18, 2009

I've been following a codeproject article on using the interop forms toolkit (basically a way for developers to slowly upgrade their VB6 projects to .net by allowing .net components run in VB6)

[URL]

While the .NET form is working fine in all other testing projects and environments, I've found that the Form_load event is actually firing twice once it's in executing in the VB6 runtime.Not only annoying, its forcing my initialization code to execute twice (causing all kind of problems on the second run).

If (runBefore = True) Then

View 1 Replies

Forms :: Load Event Only Fires One Time (Loosing Handle)

Jul 17, 2011

I have a form for which the form load event only fires one time. When the program starts. It will not fire again until I end the program and restart. I have tried .show and .showdialog, but it acts the same. I have read about form load events loosing the handles, but my code looks exactly like it should.

Here is the load event code
PrivateSub frmBilling_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
LoadClients()
LoadTherapists()
LoadCPT() EndSub

Here is the code that calles the form.
PrivateSub BillingToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BillingToolStripMenuItem.ClickfrmBilling.Show()
frmbilling.show()
EndSub

View 1 Replies

TreeView With Checkboxes, Double Click Only Fires After Chack Event Once?

Dec 10, 2008

I have a tree view with checkboxes. When a user checks an item in the tree, all items below it in the tree should be checked automatically to match the parent. The same is true is a user unchecks an item. That's been reasonably easy to implement using the after check event:-

Private Sub tvwUserGroups_AfterCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles tvwUserGroups.AfterCheck
If Not m_Isloading _

[code].....

View 7 Replies

Wpf - Change The Background Color Of An Element When The MouseEnter Event Fires?

May 8, 2011

I want to change the background color of an element when the mouseEnter event fires. How to make the color of the background darker?? I thought I can use an opacity mask, but it's a gradient, but I need it to be solid. Also it has to be in visual basic code, not in xaml.

View 2 Replies

Modify .net's BackgroundWorker Class So That It Fires A Custom Event Upon Method Completion?

Nov 16, 2011

I have a BackgroundWorker in a vb.net program that is doing a lengthy data import routine. I want to modify its RunWorkerAsync method so that it fires a custom event on completion of the method. (So that a method in an automated process can respond to the event and resume its work). In a sense I want to 'extend' the RunWorkerAsync method to add an extra line of code--but I can't 'see' the code in the method (to just add the line raising the event) because BackgroundWorker is an MSDN class from Microsoft.The only solution that I can think of is to 'wrap' the background worker class in a wrapper that calls the .RunWorkerAsync method and then raises the event.

Public sub wrapperMethod()
myBackgroundWorker.RunWorkerAsync()
raise customEvent
end sub

Is there a design pattern that I might use? An easy way to address this with the .net language?

PS: Unfortunately, I'm automating some clanking legacy software and backgroundworker is used in many locations, so wrapping the backgroundworker will be a bit of work and may open bugs.

View 1 Replies

RowChanged Event Fires And Throws An Error During DataAdapter.Fill(DataTable)?

Mar 12, 2011

At the top of my code for the form I have the following statements (and some other unrelated ones to):

Dim LastDataRow As DataRow
Public Event RowChanged As DataRowChangeEventHandler

When my form loads I run the following line of code:

AddHandler dt.RowChanged, New DataRowChangeEventHandler(AddressOf Row_Changed)

After the form loads I have a FetchData button which connects to the database and brings the records into a datatable object. During this fill operation my Row_Changed event fires (for every record I think) and tries to run DataAdapter.Update(DataTable) (pseudocode) which ultimately fails because I haven't yet created commands. The error I get in my Row_Changed procedure is:

Update requires a valid InsertCommand when passed DataRow collection with new rows.I hadn't even planned to use an InsertCommand at all since I will not be allowing users to insert records from this form. I do plan to allow them to delete or modify existing records, but not insert new ones.run my AddHandler statement after filling the datatable. However, I'm trying to figure out how to rewrite my code so that I can refresh the datatable without closing out the form/application and having to open it up again. I think that's a problem for a separate discussion.

View 1 Replies

Why The Mouse_Leave Event Fires When Don't Leave The Control With The Mouse Pointer In This Situation

Jun 11, 2011

Anyone know why the Mouse_Leave event fires when you don't leave the control with the mouse pointer?Put a large button on a Form so your mouse pointer does not leave it easily.Then try this codeWhen you do, leave the mouse pointer in the middle of the button and then click the button.By the way, if you uncomment the 1st line of code in the Button Click event and comment out the MessageBox, this does not happen.Can someone please explain this behaviour?

Option Strict On
Option Explicit On
Option Infer Off

[code].....

View 5 Replies

User Clicks On A Picture Box It Moves Around With The Mouse?

Mar 4, 2009

Basicly If a user clicks on a picture box it moves around with the mouse, How can I make it so the user has to be holding down mouse1 (draging the picture box) and if they are not holding down mouse1 it drops

View 3 Replies

DataGridView's RowValidating Event Fires Differently When Closing A Modal Vs NonModal Form

Mar 24, 2011

Based on our tests primarily done in VB.NET in VS2010 it seems that when you close a WinForm the "RowValidating" event of the DataGridView on that form behaves differently depending on whether the form is MODAL or NON-MODAL. What we did was open the form (MODAL and NONMODAL) and changed a value of a cell and then immediately clicked the "X" to close the form. It looks like the "RowValidating" event DOESN'T fire if the grid is on a MODAL form but it DOES fire when the grid is on a NON-MODAL form. We can't figure out why that is... Is this a known bug in .NET?

[Code]...

View 3 Replies

Get The Same Result As In The Original Minesweeper For When A User Clicks And Moves The Mouse Around

Jan 10, 2010

I have fully programmed my Minesweeper; however, I was having difficulty trying to get the same result as in the original minesweeper for when a user clicks and moves the mouse around while still right clicking. You may notice that in the original Minesweeper, when a user does as explained, the tiles that the user goes to will then look blank. If the user releases the mouse, the current tile they hovered to will become the clicked tile. In my Minesweeper, the tile I click on is the only one that will look blank, and when I hover over to the next tiles, they do not get blank like the first one I clicked on. Then when I release my mouse button when over to another tile, the very first tile I clicked on is the one that gets uncovered.

Here is what I already have used. I have the MouseDown event which checks to see if the game has been started to begin the game timer. It also has some color properties for tiles when I click on them and I set a boolean to true or false depending on the user left or right click. I have the MouseUp event which looks at the boolean to determin what the user had clicked on the mouse so I know if I flag or simply click to uncover. Then I have the MouseEnter and MouseLeave which are needed to yield the proper glow I want for the tiles. What should I do to get the same results as in the original Minesweeper with the MouseDown and MouseEnter into other tiles? I tried many other things such as MouseEnter, MouseMove and MouseHover, but all seem to yield the same crummy result as what I already have.

[Code]....

View 1 Replies

Program That Moves A Picture To Whatever Location User Puts Into Text Boxes

Feb 18, 2011

I have a problem that I can not seem to get. I have a program that moves a picture to what ever location the user puts into the text boxes. It works as I wanted it to but my problem is when a user puts in anything but a number into the text box it gives an error, I want a message to pop up and let them know that a numbers needs to be entered not a text.

View 6 Replies

C# - Mouse Event Fires When The Mouse Over Child Control?

Aug 24, 2011

I have set the controls mouse enter and mouse leave events. My problem is that the mouse leave event fires if I mouse over any of the child controls (like the name box for example).What I need is for the mouse leave event to fire when my mouse leaves the entire control, rather than firing when I mouse over any of the child controls. Here are the events as I have them so far:

Private Sub DeliveryControl_MouseEnter(sender As System.Object, e As System.EventArgs) Handles MyBase.MouseEnter
Me.removeImage.Visible = True
End Sub

[code]....

View 1 Replies

[Timer] Trigger Event Manually - User Must Wait For A Minute Before The Event Is Triggered

Feb 12, 2010

Eg. ""vb.net" timer event trigger on purpose". This application is meant to run at all times to download a web page every minute. To avoid freezing the UI, I read that the best solution is to move the code from a While/Sleep loop to a Timer that will be triggered every minute. The problem I have, is that the user must wait for a minute before the event is triggered:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Interval = 60000
Timer1.Enabled = True

[CODE]...

Is it possible to force this event to occur instead of waiting for it?

View 1 Replies

Code For Splitter In .net?

Mar 6, 2009

I have a treeview and a gridview in my page.My application is windows application in vb.I want to use splitter to move treeview and a gridview.Can anyone help to give the splitter code to do this.

View 1 Replies

Splitter For 3 Panel?

Sep 8, 2010

I'm trying to make a email application. But when i use 2 splitters (1 vertical and 1 horizontal) The Horizontal will move but the vertical one doesn't. BTW if i move the horizontal it won't change size or position.

View 6 Replies

Way To Show Up Splitter Bar More?

Jan 22, 2010

I have a form that has two sections that are resizeable using a splitcontainter.It all works great, but I was wondering if there is a way to make the splitter bar you use for the resize more obvious?I can't find a setting to turn just the split bar 3d or add a style to just the split bar. is this not possible, or am I missing something?

View 3 Replies

.NET Splitter Control Display?

May 26, 2009

I created a Winform in VB.NET, and I added a Splitter control to allow resizing of panels during runtime.My issue is that the splitter control is not apparent. I would like to make it appear in a way that the user would know the form can be resized. At the moment, I basically just changed the color, but I don't like how that looks.

View 4 Replies

Add Splitter Control For Each Group?

Jan 9, 2010

My form have many groups controls.How can i add splitter control for each group.

View 1 Replies

VS 2005 Splitter With Button?

Jul 21, 2011

splitterbar to have a button where i can hide, resize the panel or expandablecollaspe themI want to use splitContainer where I can resize between the two panels expandablecollaspe them, but I can't make the button on the splitterbar.

View 8 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved