Patimă Variabil between Ferestre Format Ferestre fără ShowDialog()
Cînd tu ești programming un Ferestre Format cerere, tu vei invariably nevoie la spre a lua variabil de la un secundă format fereastră, such as un opțiune format sau popular cercetare prompt.
Most de la ghid afară acolo voință a voi tell tu that tu ai la spre deschidere art.hot. secundă format cu ShowDialog(), care butuc art.hot. user de la doing ceva else pînă la ei’ închis art.hot. secundă format fereastră. This wont’ work foarte well pentru un află/replace disc, pentru a instala. It de asemenea wont’ work foarte well pentru obicei tragere popular format.
Art.hot. iute way la spre patimă variabil between art.hot. format is folosire Delegates. Tu poți a ezat a aranja un eventhandler pentru art.hot. Închis seară de la secundă format, și mîner art.hot. seară în primul format. This allows tu la spre capture variabil înainte art.hot. secundă format fereastră has închis.
Pentru this exercise, were’ mergi la a asigura that noi avem doi format:
MainForm
OptionsForm
Were’ mergi la mai îndepărtat a asigura that weve’ pocnitură niște sort de nasture that deschidere art.hot. OptionsForm cu un Manifestare() method chemare. Acum lets’ a lua un privește la art.hot. magic:
……. snip…….
OptionsForm theform = nou OptionsForm();
theform.Closing += nou CancelEventHandlertheform_Closing();
theform.Show();}
particular void theform_Closingobject( expeditor, CancelEventArgs e)
{OptionsForm theform = (OptionsFormsender);
Grab art.hot. variabil de la opțiune format. Art.hot. opțiune format voi this variabil înainte it închis, și art.hot. variabil voi a fi piață as public.
fibros local = theform.thestringvariable;}
Thats’ tot acolo is la spre it.

Daily Poștă electronică Updates
Tu poți a lua our cum- la spre anghinară înăuntru al tău inbox each zi pentru drum liber. Chiar enter al tău nume și poștă electronică sub:


I oaspete this works better :
theform.FormClosing += nou FormClosingEventHandlertheform_Closing();
Mulțumiri it ajutor eu foarte mult la spre figure it afară oriunde.
it worked pentru eu as well înăuntru mare deal
UN mare mulțumiri pentru art.hot. persoană cine has a da art.hot. hint