Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DialogResult = OK
Message
De
02/02/2005 18:38:42
 
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00983255
Message ID:
00983288
Vues:
17
>Thank you very much for the solution. Come to think of it that is how I used to do the same thing in VFP.<

You're welcome. See, VFP isn't all that different from .NET now, is it? < vbg >

~~Bonnie



>
>>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
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform