Search code examples
.netwindowswinformshandles

Windows handle if a control is set to visible = false (.NET)


Quick question, do controls in .NET have handles (hWnd) if they are set to invisible?

Marlon


Solution

  • The handle is created when the Visible property becomes true. If it was set to true in the form constructor, the most common case for controls, that will happen when the form is created, right before the Load event. Setting Visible to false again doesn't destroy the handle.