Share via


SystemPens.GrayText Proprietà

Definizione

Ottiene un oggetto Pen che corrisponde al colore del testo in grigio.

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

Valore della proprietà

Pen

Oggetto Pen che corrisponde al colore del testo disattivato.

Esempio

Nell'esempio di codice seguente viene illustrato come utilizzare la GrayText proprietà . Per eseguire questo esempio, incollarlo in un Windows Form. Gestire l'evento del Paint modulo e chiamare il DrawWithGrayTextPen metodo dal Paint metodo di gestione degli eventi, passando e come PaintEventArgs.

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

End Sub

Commenti

Gli elementi disabilitati di un elenco vengono visualizzati come testo in grigio.

Si applica a