VisualStyleElement.Window.Caption Sınıf

Tanım

VisualStyleElement Bir pencerenin başlık çubuğunun her durumu için nesneler sağlar. Bu sınıf devralınamaz.

public: ref class VisualStyleElement::Window::Caption abstract sealed
public static class VisualStyleElement.Window.Caption
type VisualStyleElement.Window.Caption = class
Public Class VisualStyleElement.Window.Caption
Devralma
VisualStyleElement.Window.Caption

Örnekler

Aşağıdaki kod örneği, özelliği tarafından Active döndürülen ile VisualStyleElement nasıl oluşturulacağını VisualStyleRenderer gösterir. Bu örneği çalıştırmak için windows formuna yapıştırın. Formun Paint olayını işleyip yöntemini olay işleme yönteminden Paint olarak geçirerek çağırın eDrawVisualStyleElementWindowCaption1PaintEventArgs.

public void DrawVisualStyleElementWindowCaption1(PaintEventArgs e)
{
    if (VisualStyleRenderer.IsElementDefined(
        VisualStyleElement.Window.Caption.Active))
    {
        VisualStyleRenderer renderer =
             new VisualStyleRenderer(VisualStyleElement.Window.Caption.Active);
        Rectangle rectangle1 = new Rectangle(10, 50, 50, 50);
        renderer.DrawBackground(e.Graphics, rectangle1);
        e.Graphics.DrawString("VisualStyleElement.Window.Caption.Active",
             this.Font, Brushes.Black, new Point(10, 10));
    }
    else
        e.Graphics.DrawString("This element is not defined in the current visual style.",
             this.Font, Brushes.Black, new Point(10, 10));
}
Public Sub DrawVisualStyleElementWindowCaption1(ByVal e As PaintEventArgs)
    If (VisualStyleRenderer.IsElementDefined( _
     VisualStyleElement.Window.Caption.Active)) Then
        Dim renderer As New VisualStyleRenderer _
          (VisualStyleElement.Window.Caption.Active)
        Dim rectangle1 As New Rectangle(10, 50, 50, 50)
        renderer.DrawBackground(e.Graphics, rectangle1)
        e.Graphics.DrawString("VisualStyleElement.Window.Caption.Active", _
          Me.Font, Brushes.Black, New Point(10, 10))
    Else
        e.Graphics.DrawString("This element is not defined in the current visual style.", _
          Me.Font, Brushes.Black, New Point(10, 10))
    End If
End Sub

Açıklamalar

sınıfının her özelliği VisualStyleElement.Window.Caption , bir VisualStyleElement pencerenin başlık çubuğunun farklı bir durumu için bir döndürür.

Özellikler

Active

Etkin bir pencerenin başlık çubuğunu temsil eden görsel stil öğesini alır.

Disabled

Devre dışı bırakılmış pencerenin başlık çubuğunu temsil eden görsel stil öğesini alır.

Inactive

Etkin olmayan bir pencerenin başlık çubuğunu temsil eden görsel stil öğesini alır.

Şunlara uygulanır

Ayrıca bkz.