恋恋不忘灭绝,南阳王朱灿,衍水星空
在winform中使用devexpress时经常使用panelcontrol控件用来进行布局设计,因此需要在代码中生成控件并添加子控件。
一种是设置要添加的自控件的parent属性为容器控件。
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;
最常用的还是通过控件的controls属性的add方法将子控件添加进来。
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);
注:
博客首页:
关注公众号
霸道的程序猿
获取编程相关电子书、教程推送与免费下载。
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Blazor server side 自家的一些开源的, 实用型项目的进度之 CEF客户端
.NET IoC模式依赖反转(DIP)、控制反转(Ioc)、依赖注入(DI)
vue+.netcore可支持业务代码扩展的开发框架 VOL.Vue 2.0版本发布
网友评论