public virtual void ControlTheme(object control) { if (control.GetType().Name.ToString() == "UCBtnExt") { UCBtnExt c = (UCBtnExt)control; c.FillColor = System.Drawing.Color.Red; c.BtnForeColor = System.Drawing.Color.White; } }
public override void ControlTheme(object control) { base.ControlTheme(control); //按控件设置主题 //如果是按钮 if (control.GetType().Name.ToString() == "UCBtnExt") { UCBtnExt c = (UCBtnExt)control; c.FillColor = System.Drawing.Color.Blue; } //如果是按钮 if (control.GetType().Name.ToString() == "UCBtnFillet") { UCBtnFillet c = (UCBtnFillet)control; c.FillColor = System.Drawing.Color.Blue; c.ForeColor = System.Drawing.Color.White; } //如果是XXX }
public void BindingData() { if (this.resultJSON.data.checkItemList.Count > 0) { this.comboBox1.DataSource = this.resultJSON.data.checkItemList; this.comboBox1.DisplayMember = "propName"; this.comboBox1.ValueMember = "tempPropID"; } if (this.resultJSON.data.hotCheckItemList.Count > 0) { for (int i = 0; i < this.resultJSON.data.hotCheckItemList.Count; i++) { int x = 114 + (83 * i) + (83 * i); if (x < this.pal_home_fill_fill_fill_3.Width) { UCBtnExt myBtnExt = new UCBtnExt(); myBtnExt.ConerRadius = 25; myBtnExt.IsRadius = true; myBtnExt.BackColor = System.Drawing.Color.Transparent; myBtnExt.BtnBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(212)))), ((int)(((byte)(197))))); myBtnExt.BtnFont = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); myBtnExt.BtnForeColor = System.Drawing.Color.White; myBtnExt.BtnText = this.resultJSON.data.hotCheckItemList[i].propName; myBtnExt.Tag = this.resultJSON.data.hotCheckItemList[i].tempPropID; myBtnExt.Font = new System.Drawing.Font("微软雅黑", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); myBtnExt.ForeColor = System.Drawing.Color.White; myBtnExt.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(212)))), ((int)(((byte)(197))))); myBtnExt.Location = new System.Drawing.Point(x, 6); myBtnExt.RectColor = System.Drawing.Color.Transparent; myBtnExt.RectWidth = 1; myBtnExt.Size = new System.Drawing.Size(83, 32); myBtnExt.BtnClick += new EventHandler(MyBtnExt_Click); this.pal_home_fill_fill_fill_3.Controls.Add(myBtnExt); } } } }