Cancel Button Click

PROKA

Junior Contributor
Joined
Sep 3, 2003
Messages
249
Location
Bucharest
Ok so I have a form with a Button on it. ( let's call it button1 )

When the user clicks it , I want to check a condition :

a = true ? > then cancel the click
Else > Continue as if there was no condition

it was something like e.handled = false but I forgot and I don't seem to remember exactly
 
Theoretically I could easily use an "Exit Sub" statement, but the problem is that this button has the property "DialogResult = OK" so if I click it, it closes my form.
 
e.Handled = True It was the command to block a keystroke ... How about the click of an button with DialogResult = OK . Does any1 know ? :(
 
Back
Top