VisualStyleElement.Window.SmallMinCaption.Active 屬性

定義

取得視覺化樣式項目,表示最小化現用小視窗的標題列。

public static System.Windows.Forms.VisualStyles.VisualStyleElement Active { get; }

屬性值

VisualStyleElement,表示最小化現用小視窗的標題列。

範例

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

public void DrawVisualStyleElementWindowSmallMinCaption1(PaintEventArgs e)
{
    if (VisualStyleRenderer.IsElementDefined(
        VisualStyleElement.Window.SmallMinCaption.Active))
    {
        VisualStyleRenderer renderer =
             new VisualStyleRenderer(VisualStyleElement.Window.SmallMinCaption.Active);
        Rectangle rectangle1 = new Rectangle(10, 50, 50, 50);
        renderer.DrawBackground(e.Graphics, rectangle1);
        e.Graphics.DrawString("VisualStyleElement.Window.SmallMinCaption.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));
}

備註

您可以使用 VisualStyleElement 屬性傳回的 Active 來建立 VisualStyleRenderer

適用於

產品 版本
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9