C control validating event
Capture the mousedown event, then see if the click is in the location of one of the controls your allowing it to move to.I think (but could be wrong) the mousedown will happen before your validate. Chris "Alex Bink" Hi, I have a validating event on a textbox in which I want to prevent the user to leave the textbox without entering the right data.like I said, read the other link), so you don't have to test for which control has focus in your Validating event handler. It was a little more difficult to understand than I hoped, but my program works now the way I want it to. Moving focus from textbox 1 to textbox 2 or from textbox 2 to textbox 1 should not fire a validating event.But moving out of textbox 1 or textbox 2 to another control should fire the validating event.Thus in masked mode the entered values always match the edit masks. This event lets you check the value entered before it is accepted.
This is just a brainstorming idea, you'd have to play with it to see if it would work.Only if he clicks on another specific control he is allowed to leave the textbox without entering the right information.Is there a way to determine which other control was clicked in the validating event of the textbox?By default when the editor fails validation an error icon with a tooltip is displayed.The editor remains focused thus forcing end-users to correct the entered value: To implement a custom response to invalid values being entered the Base Edit. For instance, you can suppress the default behavior of an error icon and tooltip being displayed and display a custom message instead or revert to the old value, etc.