通过


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

包含事件数据的 A 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相关的参数。

适用于

另请参阅