VisualStyleElement.ToolBar.SplitButton Osztály

Definíció

Objektumokat biztosít VisualStyleElement egy kombinált normál gomb és legördülő gomb normál gomb részének minden állapotához. Ez az osztály nem örökölhető.

public: ref class VisualStyleElement::ToolBar::SplitButton abstract sealed
public static class VisualStyleElement.ToolBar.SplitButton
type VisualStyleElement.ToolBar.SplitButton = class
Public Class VisualStyleElement.ToolBar.SplitButton
Öröklődés
VisualStyleElement.ToolBar.SplitButton

Példák

Az alábbi példakód bemutatja, hogyan hozhat létre egy VisualStyleRenderer tulajdonság által visszaadott VisualStyleElement kóddalHotChecked. A példa futtatásához illessze be egy Windows űrlapba. Kezelje az űrlap eseményét Paint , és hívja meg a DrawVisualStyleElementToolBarSplitButton6 metódust az Paint eseménykezelési metódusból, és e adja át a következőt PaintEventArgs: .

public void DrawVisualStyleElementToolBarSplitButton6(PaintEventArgs e)
{
    if (VisualStyleRenderer.IsElementDefined(
        VisualStyleElement.ToolBar.SplitButton.HotChecked))
    {
        VisualStyleRenderer renderer =
             new VisualStyleRenderer(VisualStyleElement.ToolBar.SplitButton.HotChecked);
        Rectangle rectangle1 = new Rectangle(10, 50, 50, 50);
        renderer.DrawBackground(e.Graphics, rectangle1);
        e.Graphics.DrawString("VisualStyleElement.ToolBar.SplitButton.HotChecked",
             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 DrawVisualStyleElementToolBarSplitButton6(ByVal e As PaintEventArgs)
    If (VisualStyleRenderer.IsElementDefined( _
     VisualStyleElement.ToolBar.SplitButton.HotChecked)) Then
        Dim renderer As New VisualStyleRenderer _
          (VisualStyleElement.ToolBar.SplitButton.HotChecked)
        Dim rectangle1 As New Rectangle(10, 50, 50, 50)
        renderer.DrawBackground(e.Graphics, rectangle1)
        e.Graphics.DrawString("VisualStyleElement.ToolBar.SplitButton.HotChecked", _
          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

Megjegyzések

Az osztály minden tulajdonsága VisualStyleElement.ToolBar.SplitButton a reguláris gomb és a legördülő gomb normál gombrészének eltérő állapotát adja vissza VisualStyleElement .

Tulajdonságok

Name Description
Checked

Lekéri a kijelölt állapotban lévő felosztott gombot jelképező vizuális stíluselemet.

Disabled

Lekéri a letiltott állapotban lévő osztott gombot jelképező vizuális stíluselemet.

Hot

Lekéri a gyakori elérésű állapotban lévő felosztott gombot jelképező vizuális stíluselemet.

HotChecked

Lekéri a gyakori és a bejelölt állapotban lévő felosztott gombot ábrázoló vizuális stíluselemet.

Normal

Lekéri a normál állapotban lévő osztott gombot jelképező vizuális stíluselemet.

Pressed

Lekéri a lenyomott állapotban lévő felosztott gombot jelképező vizuális stíluselemet.

A következőre érvényes:

Lásd még