Поделиться через


VisualStyleElement.MenuBand.NewApplicationButton.Checked Свойство

Определение

Возвращает элемент визуального стиля, представляющий новую кнопку приложения в проверенном состоянии.

public:
 static property System::Windows::Forms::VisualStyles::VisualStyleElement ^ Checked { System::Windows::Forms::VisualStyles::VisualStyleElement ^ get(); };
public static System.Windows.Forms.VisualStyles.VisualStyleElement Checked { get; }
static member Checked : System.Windows.Forms.VisualStyles.VisualStyleElement
Public Shared ReadOnly Property Checked As VisualStyleElement

Значение свойства

Значение, VisualStyleElement представляющее новую кнопку приложения в проверенном состоянии.

Примеры

В следующем примере кода показано, как создать объект VisualStyleRenderer с VisualStyleElement возвращаемым свойством Checked . Чтобы запустить этот пример, вставьте его в Форму Windows Form. Обработайте событие формы Paint и вызовите DrawVisualStyleElementMenuBandNewApplicationButton5 метод из Paint метода обработки событий, передавая e как PaintEventArgs.

public void DrawVisualStyleElementMenuBandNewApplicationButton5(PaintEventArgs e)
{
    if (VisualStyleRenderer.IsElementDefined(
        VisualStyleElement.MenuBand.NewApplicationButton.Checked))
    {
        VisualStyleRenderer renderer =
             new VisualStyleRenderer(VisualStyleElement.MenuBand.NewApplicationButton.Checked);
        Rectangle rectangle1 = new Rectangle(10, 50, 50, 50);
        renderer.DrawBackground(e.Graphics, rectangle1);
        e.Graphics.DrawString("VisualStyleElement.MenuBand.NewApplicationButton.Checked",
             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 DrawVisualStyleElementMenuBandNewApplicationButton5(ByVal e As PaintEventArgs)
    If (VisualStyleRenderer.IsElementDefined( _
     VisualStyleElement.MenuBand.NewApplicationButton.Checked)) Then
        Dim renderer As New VisualStyleRenderer _
          (VisualStyleElement.MenuBand.NewApplicationButton.Checked)
        Dim rectangle1 As New Rectangle(10, 50, 50, 50)
        renderer.DrawBackground(e.Graphics, rectangle1)
        e.Graphics.DrawString("VisualStyleElement.MenuBand.NewApplicationButton.Checked", _
          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 возвращаемый Checked свойством VisualStyleRenderer.

Применяется к