Share via


SystemPens.HighlightText 屬性

定義

取得 Pen,也就是所選項目的文字色彩。

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

屬性值

Pen

Pen,為選取項目的文字色彩。

範例

下列程式代碼範例示範如何使用 HighlightText 屬性。 若要執行此範例,請將它貼到 Windows Form 中。 處理表單的事件 Paint ,並從事件處理方法呼叫 DrawWithHighlightTextPen 方法 Paint ,並 e 傳遞為 PaintEventArgs

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

End Sub

備註

選取的專案可能包含功能表項和選取的文字。 例如,畫筆可能是用於清單框中所選項目文字的色彩。

適用於