Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Basic Memory Management Form.Show

Tags:

vba

I have a question on memory management within Visual Studio using Visual Basic.

I have a form with a button. When the button is pressed a second form that I have created appears. I am using the code below to show the second form:

Form2.show()

My question is: When I press the button in the first form , is the second form loaded into memory, or has it been loaded from the start of the program, but just hidden?

Is there a way to unload the form after it has been loaded, so that it doesn't take up memory anymore?

like image 864
Elias Wick Avatar asked Sep 04 '26 04:09

Elias Wick


1 Answers

Use Unload Form2 to unload the form from memory. The show method simply shows the already memory loaded form.

Load Form2 is used to load the form into memory. But Form2.Showis only used to show it for the user.

like image 111
Gowire Avatar answered Sep 07 '26 07:09

Gowire



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!