Adding to control the use of DevExpress Winform in child control method

Scenes

WInform often used when using DevExpress PanelControl used to control the layout, it is necessary to generate a control code and add child controls.

achieve

One is set from the control Parent property to be added to the container control.

PanelControl panelControlX = new PanelControl();
 TextEdit minTextEditX = new TextEdit();
            minTextEditX.Text = xAttribute.Min.ToString();
            minTextEditX.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
            minTextEditX.Width = Global.CHART_OPTION_WIDTH;
            minTextEditX.Location = new Point(Global.NOGROUP_HORIZONTAL_DISTANCE , Global.GROUP_VERTICAL_DISTANCE * 2 + radioGroupX.Height);
            minTextEditX.Parent = panelControlX;

 

The most common method is through the Add Controls property of the control will add in child controls.

PanelControl panelControlY = new PanelControl();
LabelControl labelY = new LabelControl();
labelY.Text = "Y" + yList[i].No;
labelY.Location = new Point(20, Global.GROUP_VERTICAL_DISTANCE - labelY.Height);
panelControlY.Controls.Add(labelY);

 

Note:

Home blog:

https://blog.csdn.net/badao_liumang_qizhi

Public concern number
overbearing program ape
acquisition-related programming e-books, tutorials and push for free download.


 

Guess you like

Origin www.cnblogs.com/badaoliumangqizhi/p/11504523.html