VisualStyleElement.Window.MaxCaption.Active 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
會獲得一個視覺樣式元素,代表最大化的活動視窗標題列。
public:
static property System::Windows::Forms::VisualStyles::VisualStyleElement ^ Active { System::Windows::Forms::VisualStyles::VisualStyleElement ^ get(); };
public static System.Windows.Forms.VisualStyles.VisualStyleElement Active { get; }
static member Active : System.Windows.Forms.VisualStyles.VisualStyleElement
Public Shared ReadOnly Property Active As VisualStyleElement
屬性值
A VisualStyleElement 代表最大化的活躍視窗標題列。
範例
以下程式碼範例示範如何用屬性VisualStyleElement回傳Active的 來建立 aVisualStyleRenderer。 要執行這個範例,請將它貼到 Windows 表單中。 處理表單的Paint事件,並從DrawVisualStyleElementWindowMaxCaption1事件處理方法呼叫該Paint方法,傳遞e為 PaintEventArgs。
public void DrawVisualStyleElementWindowMaxCaption1(PaintEventArgs e)
{
if (VisualStyleRenderer.IsElementDefined(
VisualStyleElement.Window.MaxCaption.Active))
{
VisualStyleRenderer renderer =
new VisualStyleRenderer(VisualStyleElement.Window.MaxCaption.Active);
Rectangle rectangle1 = new Rectangle(10, 50, 50, 50);
renderer.DrawBackground(e.Graphics, rectangle1);
e.Graphics.DrawString("VisualStyleElement.Window.MaxCaption.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 DrawVisualStyleElementWindowMaxCaption1(ByVal e As PaintEventArgs)
If (VisualStyleRenderer.IsElementDefined( _
VisualStyleElement.Window.MaxCaption.Active)) Then
Dim renderer As New VisualStyleRenderer _
(VisualStyleElement.Window.MaxCaption.Active)
Dim rectangle1 As New Rectangle(10, 50, 50, 50)
renderer.DrawBackground(e.Graphics, rectangle1)
e.Graphics.DrawString("VisualStyleElement.Window.MaxCaption.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
備註
你可以利用屬性回傳Active的 VisualStyleElement s 來建立一個 VisualStyleRenderer。