Returning data to a form

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Returning data to a form

robinsiebler
I have 2 forms, form a has a button that launches form b. Form b has 2 textboxes and an OK button.  When the OK button is clicked, I want the form to close and the data to be returned to form a. How do I do this?
Reply | Threaded
Open this post in threaded view
|

Re: Re turning data to a form

Michael Foord-3
On 28/11/2010 18:47, robinsiebler wrote:
> I have 2 forms, form a has a button that launches form b. Form b has 2
> textboxes and an OK button.  When the OK button is clicked, I want the form
> to close and the data to be returned to form a. How do I do this?
One way is to show the second form modally (with a call to ShowDialog I
believe), this will freeze the first form until the second form exits.

Another way would be to hide the first form when the second one is
shown. Give the second form a reference to the first one, and in the
handler functions for the accept / cancel buttons for the second form
re-show the first form.

All the best,

Michael

--

http://www.voidspace.org.uk/

READ CAREFULLY. By accepting and reading this email you agree,
on behalf of your employer, to release me from all obligations
and waivers arising from any and all NON-NEGOTIATED agreements,
licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap,
confidentiality, non-disclosure, non-compete and acceptable use
policies (”BOGUS AGREEMENTS”) that I have entered into with your
employer, its partners, licensors, agents and assigns, in
perpetuity, without prejudice to my ongoing rights and privileges.
You further represent that you have the authority to release me
from any BOGUS AGREEMENTS on behalf of your employer.

_______________________________________________
Users mailing list
[hidden email]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Reply | Threaded
Open this post in threaded view
|

Re: Re turning data to a form

robinsiebler
But then I still only have the data in the 2nd (child) form. How do I get it to the 1st (main) form?
Michael Foord-3 wrote
On 28/11/2010 18:47, robinsiebler wrote:
> I have 2 forms, form a has a button that launches form b. Form b has 2
> textboxes and an OK button.  When the OK button is clicked, I want the form
> to close and the data to be returned to form a. How do I do this?
One way is to show the second form modally (with a call to ShowDialog I
believe), this will freeze the first form until the second form exits.

Another way would be to hide the first form when the second one is
shown. Give the second form a reference to the first one, and in the
handler functions for the accept / cancel buttons for the second form
re-show the first form.

All the best,

Michael

--

http://www.voidspace.org.uk/

READ CAREFULLY. By accepting and reading this email you agree,
on behalf of your employer, to release me from all obligations
and waivers arising from any and all NON-NEGOTIATED agreements,
licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap,
confidentiality, non-disclosure, non-compete and acceptable use
policies (”BOGUS AGREEMENTS”) that I have entered into with your
employer, its partners, licensors, agents and assigns, in
perpetuity, without prejudice to my ongoing rights and privileges.
You further represent that you have the authority to release me
from any BOGUS AGREEMENTS on behalf of your employer.

_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Reply | Threaded
Open this post in threaded view
|

Re: Re turning data to a form

Michael Foord-5


On 28 November 2010 21:06, robinsiebler <[hidden email]> wrote:

But then I still only have the data in the 2nd (child) form. How do I get it
to the 1st (main) form?


The close handler of the second form has to pass it to the first form - or just set them as attributes on the second form and let the first form look at the values after control has returned to it. (Presumably the first form is responsible for showing the second form, so it already has a reference to it.)

All the best,

Michael
 
Michael Foord-3 wrote:
>
> On 28/11/2010 18:47, robinsiebler wrote:
>> I have 2 forms, form a has a button that launches form b. Form b has 2
>> textboxes and an OK button.  When the OK button is clicked, I want the
>> form
>> to close and the data to be returned to form a. How do I do this?
> One way is to show the second form modally (with a call to ShowDialog I
> believe), this will freeze the first form until the second form exits.
>
> Another way would be to hide the first form when the second one is
> shown. Give the second form a reference to the first one, and in the
> handler functions for the accept / cancel buttons for the second form
> re-show the first form.
>
> All the best,
>
> Michael
>
> --
>
> http://www.voidspace.org.uk/
>
> READ CAREFULLY. By accepting and reading this email you agree,
> on behalf of your employer, to release me from all obligations
> and waivers arising from any and all NON-NEGOTIATED agreements,
> licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap,
> confidentiality, non-disclosure, non-compete and acceptable use
> policies (”BOGUS AGREEMENTS”) that I have entered into with your
> employer, its partners, licensors, agents and assigns, in
> perpetuity, without prejudice to my ongoing rights and privileges.
> You further represent that you have the authority to release me
> from any BOGUS AGREEMENTS on behalf of your employer.
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>

--
View this message in context: http://old.nabble.com/Returning-data-to-a-form-tp30325039p30325848.html
Sent from the IronPython mailing list archive at Nabble.com.

_______________________________________________
Users mailing list
[hidden email]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



--
http://www.voidspace.org.uk



_______________________________________________
Users mailing list
[hidden email]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com