Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling a function from one form to another
Message
From
25/07/2005 18:37:13
 
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
C# 1.1
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01035826
Message ID:
01035833
Views:
13
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform