What event fires when...
Posted on 2012-03-15
What event fires when mouse moves over X to close the form.
I guess X is part of the form because I tried using on MouseLeave but it didn't work.
I have few text boxes on a form to accept user input. I also have a button "Default Values" to populate these text boxes if the user chooses to use it.
Because the text boxes have Validated events and doesn't allow blank entries, I have:
Private Sub butDefaultValues_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles butDefaultValues.MouseEnter
'to pacify _Validated to use "Default Values" button
bolUsingDefault = True
Private Sub butDefaultValues_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles butDefaultValues.MouseLeave
'to keep _Validated active on leaving butDefaultValues
bolUsingDefault = False
This means, as soon as the mouse enters "Default Values" button, the flag bolUsingDefault is set True thus using:
Private Sub txtVinNumber_Validated(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtVinNumber.Validated
If bolUsingDefault = True Then Exit Sub
Question is how I can implement a similar technique when the user moves the mouse to close the form without _Validated event firing.