RT winform 中
我这里有几十个按钮,如果要同时切换他们的状态(就是更改它们的贴图Imgae),该怎么写代码?
难道真要像下面这样?能不能优化一下,主要从性能方面考虑,因为这样按钮有个很明显的刷新过程...... btn_ZhengFeng.Image = NoActivated;
btn_FuPai.Image = NoActivated;
btn_00LYan.Image = NoActivated;
btn_1LYan.Image = NoActivated;
btn_2LYan.Image = NoActivated;
btn_3LYan.Image = NoActivated;
btn_4LYan.Image = NoActivated;
btn_ZhaoMin.Image = NoActivated;
btn_JuanShang.Image = NoActivated;
btn_JuanXia.Image = NoActivated;
btn_00LLin.Image = NoActivated;
btn_1LLin.Image = NoActivated;
btn_2LLin.Image = NoActivated;
btn_3LLin.Image = NoActivated;
btn_4LLin.Image = NoActivated;
btn_ZiDongQiDong.Image = NoActivated;
...
...小弟虚心求教,请大家不吝赐教,先谢谢啦~!winform优化
解决方案 »
- 为何无法保存数据呢?
- api函数声明是在哪找的?
- access如何连水晶报表呀, 急!!!!
- 客户端发现响应内容类型为“text/html; charset=utf-8”,但应为“text/xml”。
- 程序中批量转换wav到mp3的问题
- 怎样在安装程序中注册COM组件和非托管的DLL?急! 急! 急!
- 愚人问一个很愚蠢的问题??水晶报表有什么好处呀,在什么时候用到比较好??
- C# Webbrowser怎么通过sessionid自动登录网页
- NET SqlDataReader对象赋值,有没有简单的方法处理一下,不用写这么多死代码!
- 窗体登录验证
- 求助!如何用edmx执行带output的存储过程
- BeginInvoke 开启线程问题
摘抄以前项目里设计器里的一段,自己找下对应的属性吧。 this.button26.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.button26.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.button26.FlatAppearance.BorderSize = 0;
this.button26.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.button26.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.button26.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.button26.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button26.Font = new System.Drawing.Font("宋体", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button26.Location = new System.Drawing.Point(655, 220);
this.button26.Name = "button26";
this.button26.Size = new System.Drawing.Size(65, 65);
this.button26.TabIndex = 26;
this.button26.UseVisualStyleBackColor = false;
命名习惯一定要好~设置下Visible属性,不用的全部隐藏掉~