How to reload windows form without closing it using VB.NET?

You cannot do that.

Why do you want to reload a form? Do you want to clear all input controls or something like that? The simplest solution might be to just do the clearing by hand.

Alternatively, you can put all your controls into a user control container. Then just instantiate that user control on your form. If you want to reload your form content, you now just need to remove and re-instantiate the user control.


I know that it is late, but useful

Me.Controls.Clear() 'removes all the controls on the form
InitializeComponent() 'load all the controls again
Form1_Load(e, e) 'Load everything in your form, load event again

Put all your initialization code into a method and not the constructor or the Form.Load event and just call that method. This can also include the designer-generated InitializeComponent() method which sets up all controls on the form. You should remove all controls on the form as your first action in that method, though.

Tags:

Vb.Net