共用方式為


SimpleShape.BackColorChanged 事件

發生時BackColor圖案的屬性變更。

命名空間:  Microsoft.VisualBasic.PowerPacks
組件:  Microsoft.VisualBasic.PowerPacks.Vs (在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)

語法

'宣告
<BrowsableAttribute(True)> _
Public Event BackColorChanged As EventHandler
[BrowsableAttribute(true)]
public event EventHandler BackColorChanged
[BrowsableAttribute(true)]
public:
 event EventHandler^ BackColorChanged {
    void add (EventHandler^ value);
    void remove (EventHandler^ value);
}
[<BrowsableAttribute(true)>]
member BackColorChanged : IEvent<EventHandler,
    EventArgs>
JScript 不支援事件。

備註

如果會引發這個事件BackColor屬性變更時以程式設計方式修改或使用者互動。

如需如何處理事件的詳細資訊,請參閱處理和引發事件

範例

下列範例顯示如何回應BackColorChanged事件處理常式中的事件。 此範例中您需要RectangleShape名 RectangleShape1 為表單上的控制項。

Private Sub RectangleShape1_BackColorChanged(
  ) Handles RectangleShape1.BackColorChanged

    ' The BackStyle must be Opaque or the BackColor has no effect. 
    If RectangleShape1.BackStyle = BackStyle.Transparent Then
        RectangleShape1.BackStyle = BackStyle.Opaque
    End If 
End Sub
private void rectangleShape1_BackColorChanged(object sender, System.EventArgs e)
{
    // The BackStyle must be Opaque or the BackColor has no effect. 
    if (rectangleShape1.BackStyle == BackStyle.Transparent)
    {
        rectangleShape1.BackStyle = BackStyle.Opaque;
    }
}

.NET Framework 安全性

請參閱

參考

SimpleShape 類別

Microsoft.VisualBasic.PowerPacks 命名空間

其他資源

Line 和 Shape 控制項簡介 (Visual Studio)

如何:使用 LineShape 控制項繪製線條 (Visual Studio)

如何:使用 OvalShape 和 RectangleShape 控制項繪製圖案 (Visual Studio)