sharkyenergy
sharkyenergy

Reputation: 4173

Reset global instance of class in VB.Net

I have a globally declared instance of a class. (must be global)

 dim myinst as new myclass

Once I have used this, I would like to "reset" it in order to use it again from scratch as if it was just declared. Something like Dispose and then just after that Dim.. Problem with dispose and dim is that it wont be global anymore.

Redim just reallocates memory (as far as i understood)

What can i do to simply reset the instance?

Thanks

Upvotes: 1

Views: 3031

Answers (1)

Yatrix
Yatrix

Reputation: 13775

MyInst = New MyClass() should do it.

Upvotes: 2

Related Questions