From: Rob on
Maybe I am going about this in the wrong way but, is there a way to "unload"
and "reload" a form ? Basically, after the user has made a significant
setting change via a combo box, I need to re-process the contents of
everything on the form to date... which happens to be everything in the form
load event.

Thanks !


From: Herfried K. Wagner [MVP] on
"Rob" <rwchome(a)comcast.net> schrieb:
> Maybe I am going about this in the wrong way but, is there a way to
> "unload" and "reload" a form ? Basically, after the user has made a
> significant setting change via a combo box, I need to re-process the
> contents of everything on the form to date... which happens to be
> everything in the form load event.

What you could do is clearning the form's 'Controls' collection, then call
'InitializeComponent', and call the code in the form's 'Load' event handler
to populate the controls.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

From: Rob on
Thanks Herfried,

I am looking in help under "Initialize" but am not quite understanding what
is meant... could you please point me to some code samples ?

Rob

"Herfried K. Wagner [MVP]" <hirf-spam-me-here(a)gmx.at> wrote in message
news:ecqPKsuBGHA.2036(a)TK2MSFTNGP14.phx.gbl...
> "Rob" <rwchome(a)comcast.net> schrieb:
>> Maybe I am going about this in the wrong way but, is there a way to
>> "unload" and "reload" a form ? Basically, after the user has made a
>> significant setting change via a combo box, I need to re-process the
>> contents of everything on the form to date... which happens to be
>> everything in the form load event.
>
> What you could do is clearning the form's 'Controls' collection, then call
> 'InitializeComponent', and call the code in the form's 'Load' event
> handler to populate the controls.
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://classicvb.org/petition/>


From: Armin Zingler on
"Rob" <rwchome(a)comcast.net> schrieb
>
> I am looking in help under "Initialize" but am not quite
> understanding what is meant...


http://msdn.microsoft.com/library/en-us/vbcon/html/vbconAnatomyOfCodeBehindWinFormsForm.asp


Armin

From: Rob on
Thanks Armin...

I see that the code shown in the listing has been auto generated by
Windows....
So, if I have a button on frmMain and I wanted to "re-initialize" frmMain,
what code would I add to the on click event of a button designed to do this
?

"Armin Zingler" <az.nospam(a)freenet.de> wrote in message
news:e6TzkRvBGHA.1544(a)TK2MSFTNGP10.phx.gbl...
> "Rob" <rwchome(a)comcast.net> schrieb
>>
>> I am looking in help under "Initialize" but am not quite
>> understanding what is meant...
>
>
> http://msdn.microsoft.com/library/en-us/vbcon/html/vbconAnatomyOfCodeBehindWinFormsForm.asp
>
>
> Armin
>