Vb net validating why am i not intimidating

I can't think of a good solution just now, but I'll let you know if I have any late-night inspirations.

Cheers, Randy Al Santino wrote: Hi Randy, Would that it were.

' Click on Button 2 to receive Button 1 validating ' event but not button 2's click event. Module Validate Test Sub Main() Dim frm As New Form() Dim btn As New Button btn. Suppose you entered invalid data into the textbox and clicked the button, should the button click event still be fired if the textbox was not validated? If the textbox has the word hello in it when Button2 is clicked, should Button2's event fire anyway? I think the OP's problem is because of the Message Box. But I'd like to use this in the case where someone enters fills in some controls on a form and then chooses to close the form. If the textbox has the word hello in it when Button2 is clicked, should Button2's event fire anyway? I think the OP's problem is because of the Message Box. Either way, I can't see how to use this idea to come up with a work-around.

I'm beginning to think this is by design, perhaps a bit unexpected, but by design. It steals focus from Button2 so that when the mouse is release, the message is not being sent to button 2. I want to give them a choice of canceling the quit, proceeding without saving, or proceeding and saving. I would expect that setting the cancel arguement to "true" would cancel the subsequent click event and setting it to false would not. It steals focus from Button2 so that when the mouse is release, the message is not being sent to button 2. But it sounds as if, rather than using the Message Box as part of validating the contents of a control, you are actually using it to validate the closing of the form.

vb net validating-72vb net validating-61vb net validating-67

I like your idea of using the form closing event but, unfortunately, the form doesn't close each time. Either way, I can't see how to use this idea to come up with a work-around.I want to give them a choice of canceling the quit, proceeding without saving, or proceeding and saving. I would expect that setting the cancel arguement to "true" would cancel the subsequent click event and setting it to false would not. I have a Split Container with a list of items on the left and a form on the right.When you click on an item in the list on the left it displays the fields for the item on the right. When you click on an item in the left the form's validate event fires to see whether you changed an item.Hi, It appears displaying a messagebox in a validating event will cancel the subsequent event. My understanding is that the second button's event should fire unless you set the cancel arg to true in the validation event handler. Run(frm) End Sub Private Sub Btn Validating(By Val sender As Object, By Val e As System. If you run the program, button 1 will start with the focus.In the program below, button 2's click event doesn't fire if you open a dialog box in button 1's validating event. Thanks Al Imports system Imports system.windows.forms ' Create a form, add two buttons and event handlers. Validating, Address Of Btn Validating btn = New Button btn. It appears displaying a messagebox in a validating event will cancel thesubsequent event. If you run the program, button 1 will start with the focus. If you click on button 2, the button 1 validating event will fire and the program will display the messagebox.

Leave a Reply