How do I get access to the parent controls of user control in C# (winform). I am using the following code but it is not applicable on all types controls such as ListBox.
You can use Control.Parent to get the parent of the control or Control.FindForm to get the first parent Form
the control is on. There is a difference between the two in terms of finding forms, so one may be more suitable to use than the other.:
The control's Parent property value might not be the same as the Form returned by FindForm method. For example, if a RadioButton control is contained within a GroupBox control, and the GroupBox is on a Form, the RadioButton control's Parent is the GroupBox and the GroupBox control's Parent is the Form.