Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling a function from one form to another
Message
De
25/07/2005 19:42:43
 
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 1.1
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01035826
Message ID:
01035846
Vues:
13
>I dont know if you can do this but the click method is on a datagrid, not a form.

First, you should add two buttons to your Dialog Form (Form2), an OK and a Cancel (Actually, I'd make the text of the OK button say "Select"). Set these properties in the IDE property sheet:

Form2 properties:

AcceptButton = MyOKButton;
CancelButton = MyCancelButton;

MyOKButton properties:

DialogResult = DialogResult.OK

MyCancelButton properties:

DialogResult = DialogResult.Cancel;

This should be all you have to do, unless you don't want the user to have to click on a button after making their selection in the DataGrid. If that's the case, then simply make the buttons invisible and fire the OK Button yourself in the DataGrid's click method:

this.MyOKButton.PerformClick();

~~Bonnie
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