ActivityDesigner.Image 屬性

定義

取得或設定與設計工具相關聯的 ImageGets or sets the Image associated with the designer.

public:  virtual property System::Drawing::Image ^ Image {  public:
System::Drawing::Image ^ get(); protected:
 void set(System::Drawing::Image ^ value); };
public virtual System.Drawing.Image Image { get; protected set; }
member this.Image : System.Drawing.Image with get, set
Public Overridable Property Image As Image

屬性值

與設計工具相關聯的 ImageThe Image associated with the designer.

範例

下列範例示範如何從內嵌資源載入 Bitmap 物件。The following example demonstrates loading a Bitmap object from an embedded resource. 在此案例中,ToolboxImage 就是基底 ActivityDesigner 類別繪製自訂 ActivityDesigner 時所使用的相同影像。In this case, the ToolboxImage is the same Image that is used when the base ActivityDesigner class draws the custom ActivityDesigner.

protected override void Initialize(Activity activity)
{
    base.Initialize(activity);
    Bitmap bmp = Resources.ToolboxImage;
    bmp.MakeTransparent();
    this.Image = bmp;
}
Protected Overrides Sub Initialize(ByVal activity As Activity)

    MyBase.Initialize(activity)
    Dim bmp As Bitmap = Resources.ToolboxImage
    bmp.MakeTransparent()
    Me.Image = bmp
End Sub

備註

Image 屬性設定為要顯示的 ImageThe Image property is set to the Image to display. 您可在設計階段或執行階段時設定。You can do this at design time or at run time.

適用於