.NET 4.6.1. I have created a windows forms usercontrol. I have changed it to inherit System.Windows.Forms.TreeView instead of Control. In it, i have added (in the designer) a label, which i decide inside the control when will the label be shown. The control is placed in a form and at runtime it is filled with a tree structure (which is done properly). The problem is that the label is not shown when its Visible property is set to True at runtime.
Public Class Treeview111
Inherits System.Windows.Forms.TreeView
...
Public Sub ShowLabel
Label1.Visible=True
End Sub
Even if the Visible property is set to be True in the designer, the Label is not shown. I have tried dynamically adding the Label at runtime but no luck. I have also tried changing it from Friend to Public but nothing. BringToFront did not help either. Checked its Location and it seems to be inside logical values (45,72).
Can't think of anything else. Am i missing something? Is what i'm trying to achieve even possible?