Can you please tell me how I can reload a windows form without closing it using VB.NET?
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.
You can use the Form. Invalidate(); or Form. Refresh(); methods.
If you want to close the form then use Me. Close() instead. The Load event will fire again when you create the new instance.
The Form Load Event in VB . NET. An important event you'll want to write code for is the Form Load event. You might want to, for example, set the Enabled property of a control to False when a form loads. Or maybe blank out an item on your menu.
Application.Restart()
Shuts down the application and immediately opens a new instance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With