共用方式為


Glyph.Paint(PaintEventArgs) 方法

定義

提供繪製邏輯。

public:
 abstract void Paint(System::Windows::Forms::PaintEventArgs ^ pe);
public abstract void Paint (System.Windows.Forms.PaintEventArgs pe);
abstract member Paint : System.Windows.Forms.PaintEventArgs -> unit
Public MustOverride Sub Paint (pe As PaintEventArgs)

參數

pe
PaintEventArgs

PaintEventArgs,其中包含事件資料。

範例

下列範例示範如何覆寫 Paint 以繪製圖像。 此程式代碼範例是針對 類別提供的較大範例的 BehaviorService 一部分。

public:
    virtual void Paint(PaintEventArgs^ pe) override
    {
        // Draw our glyph.  Our's is simple:  a blue ellipse.
        pe->Graphics->FillEllipse(Brushes::Blue, Bounds);
    }
public override void Paint(PaintEventArgs pe)
{
    // Draw our glyph. It is simply a blue ellipse.
    pe.Graphics.FillEllipse(Brushes.Blue, Bounds);
}
Public Overrides Sub Paint(ByVal pe As PaintEventArgs)
    ' Draw our glyph.  It is simply a blue ellipse.
    pe.Graphics.FillEllipse(Brushes.Blue, Bounds)

End Sub

備註

方法是 Paint 強制 abstract 實作提供繪製邏輯的方法 Glyph 。 參數 pe 包含與 Graphics 裝飾項目視窗 BehaviorService相關的 。

適用於

另請參閱