国网拆分,taiji,恶魔幸存者攻略
在同一个winform窗体中,点击一个button按钮时,
获取同窗体的其他控件的属性。
首先需要对要获取的控件赋予name属性,然后就可以通过name进行获取。
在button的点击事件中:
private void confirmbbutton_click(object sender, eventargs e) { #region 获取x轴的属性并赋值给xaxismodel //根据控件的 system.windows.forms.control.name 属性搜索控件并生成由所有匹配项组成的数组。 //如果搜索所有子控件,则为 true;否则为 false。 xaxismodel xaxismodel = new xaxismodel(); //获取标题 radiogroup radiogroupx = this.controls.find("radiogroupx", true)[0] as radiogroup; xaxismodel.title = radiogroupx.text; //获取下限 textedit mintexteditx = this.controls.find("mintexteditx", true)[0] as textedit; xaxismodel.min = double.parse(mintexteditx.text); //获取上限 textedit maxtexteditx = this.controls.find("maxtexteditx", true)[0] as textedit; xaxismodel.max = double.parse(maxtexteditx.text); //获取颜色 coloredit coloreditx = this.controls.find("coloreditx", true)[0] as coloredit; xaxismodel.color = coloreditx.text; #endregion }
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Net Core Web Api项目与在NginX下发布的方法
asp.net core3.1 引用的元包dll版本兼容性问题解决方案
IdentityServer4实现.Net Core API接口权限认证(快速入门)
ASP.NET Core MVC通过IViewLocationExpander扩展视图搜索路径的实现
网友评论