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 18:37:13
 
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:
01035833
Vues:
14
Do you need to call Form 1's method while you are in Form 2? Or will it still work if you call it in Form 1? (The only way it wouldn't work this way is if you need to do something additional in Form 2 after calling Form 1's method)

This should work as long as you have a public property on Form2 called SelectionFromForm2:
MyForm Form2 = new MyForm();
if (Form2.ShowDialog() = DialogResult.OK)
{
    this.MyForm1Method(Form2.SelectionFromForm2);
}
~~Bonnie


>Sorry, Form1 opens form2 with showdialog(), then when an item is selected on form2 it runs a function on form1 and then closes form2. I think a variable might be falling out of scope.
Bonnie Berent DeWitt
NET/C# MVP since 2003

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

Click here to load this message in the networking platform