Re: Passing Data Between Forms

From: Michael C (michaelco_at_optonline.net)
Date: 06/20/04


Date: Sun, 20 Jun 2004 03:55:08 GMT

Cool, I was trying to decide if passing the form to the constructor like you
did would be better than using public static variables, etc. I'll use your
method. Thanks!

Michael C.

"Shakir Hussain" <shak@fakedomain.com> wrote in message
news:uRe$L%23mVEHA.1356@TK2MSFTNGP09.phx.gbl...
> Micheal,
>
> there are many ways to do this. One of those is
>
> //define form1.
> Form pForm1 = new Form();
>
> //during launch of Form 2 do this
> Form pForm2 = new Form( pForm1); //pass in constructor.
> pForm2.ShowDialog(); or pForm.Show();
>
> //Once when Form2 is displayed, to pass value back to form Set through
> properties
>
> example .
> mForm1.Mybool = Form2.TestBool;
>
> mForm1 is a member in Form2 which is received in constructor. You can
> access public variables and internal variables of Form1 in Form2. The
other
> ways do is by defining event handlers and delegates.
>
> Shak
>
>
> "Michael C" <michaelco@optonline.net> wrote in message
> news:U43Bc.27161$V57.6436933@news4.srv.hcvlny.cv.net...
> > What's the best wat to pass data between two separate forms. For
> instance,
> > Form1 invokes Form2 like this:
> >
> > Form z = new Form2();
> > z.Show();
> >
> > How can I pass back strings and boolean values from Form2 to Form1?
> >
> > Thanks,
> >
> > Michael C.
> >
> >
>
>



Relevant Pages

  • Re: How does this work...
    ... Michael wrote: ... >> iterators as arguments, and creating an unnamed object which is then ... That is the form of the constructor being invoked. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: How does this work...
    ... Michael wrote: ... the bil I don't understand is the 'Rule' bit because ... It's invoking the constructor for Rule, one form of which takes two ... elements between the two iterators to initialize the newly created object. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: [patch 11/26] IPOB: Move destructor from neigh->ops to neigh_param
    ... -stable without passing it by netdev CC:'ing me first. ... Michael S. Tsirkin ...
    (Linux-Kernel)
  • Michael Jackson tribute
    ... In honor of Michael Jackson's passing, little boys' pants will be ...
    (rec.humor.funny)
  • Re: People dont want dollar coins Harris poll says
    ... passing of a President, in the same manner that the USPS issues ... Vote for Michael G. Koerner for Congress!!! ... (Wink, wink, nudge, nudge.) ...
    (rec.collecting.coins)

Quantcast