Skip to content

Form return value

Victor Baleishis

Asked Mar 28, 2006, 9:13 AM EST1 answer
Share
LinkedInX

Hi!
Can anyone tell me - how can form return any value???
For example:
I have two forms, calling frmFirst and frmSecond. frmFirst has a button and label. On button click frmSecond is loaded. frmSecond has variable varClicks which increased every time when I click on the frmSecond. And I want what label on frmFirst shows me value of varClicks... Don't matter frmSecond do it at runtime or then is closed. It's possible?

Thanks...

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Usually, I just add a public member(or private with a property for it) into the form. And then I call ShowDialog(), after that returns just reference the member directly. MyForm.MyValue and you can do this with any number of variables. Usually, I have a OK and a Cancel button on my dialogs and i have a variable i assign for the ok or cancel button and then check to make sure they hit OK before i get other values from the form.
    0