If we remove the visual component in a similar way:

this.Controls.Remove(Label1) 
, then the memory that was allocated for it is released? Thank you in advance!

    1 answer 1

    Removes the link to Label1 in the Controls collection. When all references to Label1 deleted, Label1 will become a candidate for deletion from memory as an object, and the garbage collector will someday reach it.

    • Can you throw in the norms of materials to read about the garbage collector for C #? I read something that they can be controlled, mb. I am mistaken ... - uzumaxy
    • By the way, thanks for the reply. - uzumaxy
    • You are welcome. Not a gc specialist. But I know that there is a lot of materials in open access, and you will quickly find information. So I only have this link google.com/… :) - yapycoder