Vb net cancel validating event who uses internet dating services
If so, it displays a messagebox asking whether you wish to save your changes. Mac Donald" Hello, Al, Chris's idea that the event is being "absorbed" by the Message Box may beon the right track, but I suspect this is not "by design" but is morelikely due to lack of design.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 thisidea to come up with a work-around.But it sounds as if, rather than using the Message Box as part ofvalidating the contents of a control, you are actually using it tovalidate the closing of the form.I know it doesn't address the problem of the missing click event, butperhaps you can solve your problem by modifying your approach.In a similar case when I wanted the user to validate or cancelclosing/saving, I have used the Form's Closing event for this purpose.(Well actually, since it was a base for several derived forms, I overrodethe On Closing method.) The main problem with this approach is that it isstill necessary to invoke the Validation code for the currently Active Control.I haven't yet found a good generic way to do this (in VB),and so have had to add code to each derived form to find the activecontrol and directly call its validation handler.
' 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. In the program below, button 2's click event doesn'tfireif you open a dialog box in button 1's validating event. If you click on button 2, the button 1 validating event will fire and the program will display the messagebox. Show("Btn Validating event") End Sub Private Sub Btn Click(By Val sender As Object, By Val e As System. Show("Btn Click event") End Sub End Module Hello, Al, I have tried your code (VB. After you close the message box, button 2 will get the focus but its click event will not _have fired_.
Cheers, Randy Al Santino wrote: Hi Randy, Would that it were.
I have a Split Container with a list of items on the left and a form on the right.
I haven't yet found a good generic way to do this (in VB), and so have had to add code to each derived form to find the active control and directly call its validation handler.
(I think it should be possible to locate and call the handler in a generic fashion, and I'm still hoping to figure out how to do this.) Cheers, Randy Al Santino wrote: Yes, if you remove the Message Box things work fine.