VisualStyleElement.MenuBand.NewApplicationButton 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
為選單頻段中新應用按鈕的每個狀態提供 VisualStyleElement 物件。 無法繼承這個類別。
public: ref class VisualStyleElement::MenuBand::NewApplicationButton abstract sealed
public static class VisualStyleElement.MenuBand.NewApplicationButton
type VisualStyleElement.MenuBand.NewApplicationButton = class
Public Class VisualStyleElement.MenuBand.NewApplicationButton
- 繼承
-
VisualStyleElement.MenuBand.NewApplicationButton
範例
以下程式碼範例示範如何用屬性VisualStyleElement回傳Normal的 來建立 aVisualStyleRenderer。 要執行這個範例,請將它貼到 Windows 表單中。 處理表單的Paint事件,並從DrawVisualStyleElementMenuBandNewApplicationButton1事件處理方法呼叫該Paint方法,傳遞e為 PaintEventArgs。
public void DrawVisualStyleElementMenuBandNewApplicationButton1(PaintEventArgs e)
{
if (VisualStyleRenderer.IsElementDefined(
VisualStyleElement.MenuBand.NewApplicationButton.Normal))
{
VisualStyleRenderer renderer =
new VisualStyleRenderer(VisualStyleElement.MenuBand.NewApplicationButton.Normal);
Rectangle rectangle1 = new Rectangle(10, 50, 50, 50);
renderer.DrawBackground(e.Graphics, rectangle1);
e.Graphics.DrawString("VisualStyleElement.MenuBand.NewApplicationButton.Normal",
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 DrawVisualStyleElementMenuBandNewApplicationButton1(ByVal e As PaintEventArgs)
If (VisualStyleRenderer.IsElementDefined( _
VisualStyleElement.MenuBand.NewApplicationButton.Normal)) Then
Dim renderer As New VisualStyleRenderer _
(VisualStyleElement.MenuBand.NewApplicationButton.Normal)
Dim rectangle1 As New Rectangle(10, 50, 50, 50)
renderer.DrawBackground(e.Graphics, rectangle1)
e.Graphics.DrawString("VisualStyleElement.MenuBand.NewApplicationButton.Normal", _
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.MenuBand.NewApplicationButton 每個屬性會回傳 a VisualStyleElement ,表示選單頻段中新應用按鈕的不同狀態。
屬性
| 名稱 | Description |
|---|---|
| Checked |
會獲得一個視覺樣式元素,代表已勾選狀態下的新應用程式按鈕。 |
| Disabled |
會獲得一個視覺樣式元素,代表新應用程式按鈕在停用狀態下。 |
| Hot |
會有一個視覺風格元素,代表熱狀態下的新應用程式按鈕。 |
| HotChecked |
會獲得一個視覺風格元素,代表新應用程式按鈕在熱中和已勾選狀態。 |
| Normal |
會獲得一個視覺樣式元素,代表新應用程式按鈕在正常狀態下。 |
| Pressed |
會獲得一個視覺樣式元素,代表按下狀態下的新應用程式按鈕。 |