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