【发布时间】:2010-01-19 21:18:56
【问题描述】:
我有一个用作单选按钮的 ToolStripButton。选中时,按钮周围有蓝色轮廓,但没有背景颜色。用户还不清楚该按钮是否被选中,所以我想更改背景颜色以使选中状态更加可见。
当 Checked 属性设置为 true 时,如何更改高亮颜色?
这是一个代码sn-p:
this.hideInactiveVehiclesToolstripButton.CheckOnClick = true;
this.hideInactiveVehiclesToolstripButton.ForeColor = System.Drawing.Color.Blue;
this.hideInactiveVehiclesToolstripButton.AutoSize = false;
this.hideInactiveVehiclesToolstripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.hideInactiveVehiclesToolstripButton.Image = global::ClientUI.Properties.Resources.toggleInactive;
this.hideInactiveVehiclesToolstripButton.ImageTransparentColor = System.Drawing.Color.Black;
this.hideInactiveVehiclesToolstripButton.Name = "hideInactiveVehiclesToolstripButton";
this.hideInactiveVehiclesToolstripButton.Size = new System.Drawing.Size(48, 48);
this.hideInactiveVehiclesToolstripButton.Text = "Hide Inactive Vehicles";
this.hideInactiveVehiclesToolstripButton.Click +=new System.EventHandler(this.hideInactiveVehiclesToolstripButton_Click);
【问题讨论】:
标签: c# .net c#-2.0 toolstripbutton