VisualStyleElement.Window.SmallMinCaption 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
提供 VisualStyleElement 最小化小視窗標題列中每個狀態的物件。 無法繼承這個類別。
public: ref class VisualStyleElement::Window::SmallMinCaption abstract sealed
public static class VisualStyleElement.Window.SmallMinCaption
type VisualStyleElement.Window.SmallMinCaption = class
Public Class VisualStyleElement.Window.SmallMinCaption
- 繼承
-
VisualStyleElement.Window.SmallMinCaption
範例
以下程式碼範例示範如何用屬性VisualStyleElement回傳Active的 來建立 aVisualStyleRenderer。 要執行這個範例,請將它貼到 Windows 表單中。 處理表單的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));
}
Public Sub DrawVisualStyleElementWindowSmallMinCaption1(ByVal e As PaintEventArgs)
If (VisualStyleRenderer.IsElementDefined( _
VisualStyleElement.Window.SmallMinCaption.Active)) Then
Dim renderer As New VisualStyleRenderer _
(VisualStyleElement.Window.SmallMinCaption.Active)
Dim rectangle1 As New Rectangle(10, 50, 50, 50)
renderer.DrawBackground(e.Graphics, rectangle1)
e.Graphics.DrawString("VisualStyleElement.Window.SmallMinCaption.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
備註
類別的 VisualStyleElement.Window.SmallMinCaption 每個屬性會回傳 VisualStyleElement 一個最小化小視窗標題欄的不同狀態,例如工具視窗。
屬性
| 名稱 | Description |
|---|---|
| Active |
會獲得一個視覺風格元素,代表一個最小化的活動小視窗標題列。 |
| Disabled |
會獲得一個視覺樣式元素,代表一個被最小化的停用小視窗標題列。 |
| Inactive |
會獲得一個視覺風格元素,代表一個已最小化的非活躍小視窗標題列。 |