SystemPens.HotTrack 属性

定义

获取 Pen,它是用于指定热跟踪项的颜色。

public:
 static property System::Drawing::Pen ^ HotTrack { System::Drawing::Pen ^ get(); };
public static System.Drawing.Pen HotTrack { get; }
static member HotTrack : System.Drawing.Pen
Public Shared ReadOnly Property HotTrack As Pen

属性值

Pen

一个 Pen,它是用于指定热跟踪项的颜色。

示例

下面的代码示例演示如何使用 HotTrack 属性。 若要运行此示例,请将其粘贴到 Windows 窗体中。 处理窗体的事件Paint,并从Paint事件处理方法调用 DrawWithHotTrackPen 方法,作为 ePaintEventArgs传递。

private void DrawWithHotTrackPen(PaintEventArgs e)
{
    Rectangle rectangle1 = new Rectangle(10, 10, 100, 100);
    e.Graphics.DrawRectangle(SystemPens.HotTrack, rectangle1);
}
Private Sub DrawWithHotTrackPen(ByVal e As PaintEventArgs) 
    Dim rectangle1 As New Rectangle(10, 10, 100, 100)
    e.Graphics.DrawRectangle(SystemPens.HotTrack, rectangle1)

End Sub

适用于