Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning a value from a form using C#
Message
From
06/05/2004 13:34:03
 
General information
Forum:
ASP.NET
Category:
Mobile development
Miscellaneous
Thread ID:
00901658
Message ID:
00901668
Views:
13
>>How can I return a value from the called form?

You can't. Create a property on your form, and access it from the calling control:
if (SelectAllAnimals.ShowDialog() == DialogResult.OK)
{
    this.MyVariable = SelectAllAnimals.MyReturnValue;
}
~~Bonnie


>I am displaying a form from a button on another form using the following code
>
>frmSelectAllAnimals SelectAllAnimals = new frmSelectAllAnimals() ;
>SelectAllAnimals.ShowDialog() ;
>
>
>How can I return a value from the called form?
>
>Thanks
>
>John
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform