Hi, Everybody.
I need to reload the form of my application. The application has only one form vb.net 2005.
I need a button that will call the page_load event so I can restart and reload all my settings.

basically I need to call the Sub private Page_load event().
I just need to force the reloading of the form without having to close it and reopen it.

This is the code which I need to reload:

Public Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
For Each URLname As String In My.Settings.URLtoTrackCollection


For Each item As String In My.Settings.ListboxCollection

Any help will be greatly appreciated.
Thanks in advance.

7 Years
Discussion Span
Last Post by __avd

Move all of the code in your _Load event to another method so you can call it again from any part of your code within the form.


or call the load event with Form1_Load(Me, New System.EventArgs)

No, dont ever do that. Thats a bad idea all the way around.


There are no side effects per se if you're careful developing but it breaks a few rules of logic:
* You assume that method is only going to be called when the form loads.
* When you look at a call stack and see the form's load method it might be unclear why the event is fired since it is called from a procedure after the forms window handle is created.

It's just not a good idea. How hard is it to move the code to another routine so when you look at it the code is obvious? :)



Only the person who created this thread can mark as Solved. BTW, this thread is two years old. Please do not resurrect years old thread, "me too"! Start a new thread if you have a new question.

Thread Locked.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.