We have no control over when the destructor is called, because the times it is called are determined by the garbage collector. In a general sense the garbage collector reads for items that are not being currently used by the application. When it considers an item is ready to be destroyed, it calls the destructor (if there is one) and takes back the memory that was borrowed to store the item. Destructors are also called when the application exits. Any destructor implicitly calls the Finalize method of the base class.
// So basically this:
~MyCass() // destructor
// cleanup statements
// Is eventually just implicitly converted to:
protected override void Finalize()
// Cleanup statements
You should really be more specific with your questions though.
This guy posted a spam post obviously because it's his only post, and he hasn't been online since he posted; also his account was created the same day the post was made. Granted that's how I started my account because I was leery of whether or not the site would help, but when I came back to check my post it was helpful and I decided to stay around. However I already answered the thread perfectly. We all know there are no destructors in C because it's not object oriented; so I posted a C# destructor example because it was obviously a type-o.
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...