form Unload

  • Thread starter Thread starter Rob
  • Start date Start date
R

Rob

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 !
 
Rob said:
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.
 
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
 
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
?
 
Rob said:
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 ?


I only provided the link and am not further involved in this issue. ;-)


Armin
 
Rob said:
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 ?

Unless I'm missing something, wouldn't it be extremely easy to move the code
from Form_Load into its own procedure and call that proc from anywhere you'd
like?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top