garbage collector collects unused object during runtime, OK ? i know it but never fully understood it. Like what 'unused' objects ? what makes them unused ?
and does GC works when you EXECUTE your program by clicking .exe file ?
and does GC work when i run file after being compressed by inno or WIX, for demployment purpose ?
If it's .NET, the garbage collector is running. Whether it actually does something is up for debate, but there basically won't be a time when you have to worry about manually managing memory for stuff that the garbage collector handles.
How does it know? What if you've created other objects? What if those objects create objects behind the scenes or trigger events that spawn threads that create objects? It's not quite as simple as you seem to think, and you may be misunderstanding how the garbage collector works.
There's plenty of learning material on the .NET garbage collector. Maybe if you point to parts that you don't understand rather than paraphrasing how you think reality should work, it would be easier to help clarify things for you.
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 ...