16
我有一個用作單選按鈕的ToolStripButton。當它被選中時,一個藍色的輪廓包圍着按鈕,但沒有背景色。用戶不太清楚該按鈕是否已被選中,所以我想更改背景顏色以使檢查狀態更加明顯。如何在選中時更改System.Windows.Forms.ToolStripButton突出顯示/背景顏色?
當Checked屬性設置爲true時,如何更改高亮顏色?
下面的代碼片段:
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);
非常感謝! – mwalsher 2010-01-19 23:05:08