emeraldtea
Programmer
In an application, I have nested controls(controls within controls and they are from different classes).
The Form form1 is the base. In form1, I have a panel--panel1. In anel1, I will add another panel--panel2 with several labels.(I use panel2 to group these labels.) panel2 is from another class different from form1.
For panel1, setting Anchor is straightforward.
I am wondering how I can set Anchors of labels in panel2 so that when form expands, labels in panel2 expands according?
I tried to set AnchorStyles.Left|AnchorStyles.Right for label2 in the form1. But it did not work. label2 doesn't expand.
Is this caused by nested controls since lable2 is in panel2, which is wrapped in panel1 of form1?
How to set Anchors for controls wrapped inside controls?
The Form form1 is the base. In form1, I have a panel--panel1. In anel1, I will add another panel--panel2 with several labels.(I use panel2 to group these labels.) panel2 is from another class different from form1.
For panel1, setting Anchor is straightforward.
I am wondering how I can set Anchors of labels in panel2 so that when form expands, labels in panel2 expands according?
I tried to set AnchorStyles.Left|AnchorStyles.Right for label2 in the form1. But it did not work. label2 doesn't expand.
Is this caused by nested controls since lable2 is in panel2, which is wrapped in panel1 of form1?
How to set Anchors for controls wrapped inside controls?