G
Guest
Hi,
I'm developing an application in c# for a pocket pc with Windows Mobile 5.0.
I have two forms, let's call them A and B. At a button click in form A I
want to see form B. However, I want to keep form A "alive", to go back to it
later, and collect the data received in form B.
In form B I have a public method which returns a string (the data that I
need). So the event handler for the button click in form A goes like this:
string a;
B b = new B();
b.ShowDialog();
a = b.GetData();
In form B I have some kind of OK button. I want to close and go back to form
A. So that button event just has this line:
this.Close();
What surprises me is that it works good. I thought that after this.Close()
there will be no b, and the call to b.GetData() will fail. But I see that
there is data in a after that (the correct data).
Then I tried this.Dispose() instead of this.Close() , but the results were
the same.
Can anyone please explain to me what's happening here?
Thank you very much
I'm developing an application in c# for a pocket pc with Windows Mobile 5.0.
I have two forms, let's call them A and B. At a button click in form A I
want to see form B. However, I want to keep form A "alive", to go back to it
later, and collect the data received in form B.
In form B I have a public method which returns a string (the data that I
need). So the event handler for the button click in form A goes like this:
string a;
B b = new B();
b.ShowDialog();
a = b.GetData();
In form B I have some kind of OK button. I want to close and go back to form
A. So that button event just has this line:
this.Close();
What surprises me is that it works good. I thought that after this.Close()
there will be no b, and the call to b.GetData() will fail. But I see that
there is data in a after that (the correct data).
Then I tried this.Dispose() instead of this.Close() , but the results were
the same.
Can anyone please explain to me what's happening here?
Thank you very much