Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DialogResult = OK
Message
 
To
02/02/2005 17:27:13
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00983255
Message ID:
00983269
Views:
15
Bonnie,
Thank you very much for the solution. Come to think of it that is how I used to do the same thing in VFP.

Einar

>Einar,
>
>>>Is there any way to prevent the form from closing?<
>
>Yes, put your code in the Closing event handler instead, and use the CancelArgs to cancel the close when necessary.
>
>~~Bonnie
>
>
>
>>I've got a simple input form with an OK, a Cancel button and a combobox.
>>The OK button has DialogResult = OK.
>>I thought I would add some code to the click event of the OK button just in case the user "forgot" to select something from the combobox. If nothing is selected I want to display a messagebox (or slap the user upside the head) and return back to the form. The problem I have noticed is that when DialogResult is set for the button the form closes by itself after the code has executed.
>>Is there any way to prevent the form from closing?
>>
>>Thanks,
>>Einar
Semper ubi sub ubi.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform