Bagikan melalui


VisualStyleElement.Window.SmallCloseButton Kelas

Definisi

Menyediakan VisualStyleElement objek untuk setiap status tombol Tutup dari jendela kecil. Kelas ini tidak dapat diwariskan.

public: ref class VisualStyleElement::Window::SmallCloseButton abstract sealed
public static class VisualStyleElement.Window.SmallCloseButton
type VisualStyleElement.Window.SmallCloseButton = class
Public Class VisualStyleElement.Window.SmallCloseButton
Warisan
VisualStyleElement.Window.SmallCloseButton

Contoh

Contoh kode berikut menunjukkan cara membuat VisualStyleRenderer dengan yang VisualStyleElement dikembalikan oleh Normal properti . Untuk menjalankan contoh ini, tempelkan ke dalam Formulir Windows. Tangani peristiwa formulir Paint dan panggil DrawVisualStyleElementWindowSmallCloseButton1 metode dari Paint metode penanganan peristiwa, meneruskan e sebagai PaintEventArgs.

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

Keterangan

Setiap properti VisualStyleElement.Window.SmallCloseButton kelas mengembalikan VisualStyleElement untuk status tombol Tutup yang berbeda dari jendela kecil, seperti jendela alat.

Properti

Disabled

Mendapatkan elemen gaya visual yang mewakili tombol Tutup kecil dalam status dinonaktifkan.

Hot

Mendapatkan elemen gaya visual yang mewakili tombol Tutup kecil dalam status panas.

Normal

Mendapatkan elemen gaya visual yang mewakili tombol Tutup kecil dalam keadaan normal.

Pressed

Mendapatkan elemen gaya visual yang mewakili tombol Tutup kecil dalam status ditekan.

Berlaku untuk

Lihat juga