Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Catch the close control
Message
De
11/02/2008 10:20:55
John Baird
Coatesville, Pennsylvanie, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01291393
Message ID:
01291422
Vues:
9
This message has been marked as the solution to the initial question of the thread.
>Hi everybody:
>
>Here we go again! I'm trying to avoid the user to exit the form using the X in the corner of the form. Please dont suggest to remove the control because is not allow in the design. I use the "Handles Me.FormClosing" but I need to stop closing if the user have changes that did not save. Any Ideas will be apreciated.
>
>TK
>
>PD
>
>Happy New Year 2008!!! Late but sure.


in c# you do it like this:
     private void MainForm_Closing(object sender, CancelEventArgs e)
     {
         bool shouldICloseMyForm = !DataSet.HasChanges();
         e.cancel = shouldIcloseMyForm;       
     }
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform