CheckBoxRenderer.DrawCheckBox Yöntem

Tanım

Onay kutusu denetimi çizer.

Aşırı Yüklemeler

DrawCheckBox(Graphics, Point, CheckBoxState)

Belirtilen durumda ve konumda bir onay kutusu denetimi çizer.

DrawCheckBox(Graphics, Point, Rectangle, String, Font, Boolean, CheckBoxState)

Belirtilen durumda ve konumda, belirtilen metinle ve isteğe bağlı bir odak dikdörtgeniyle bir onay kutusu denetimi çizer.

DrawCheckBox(Graphics, Point, Rectangle, String, Font, TextFormatFlags, Boolean, CheckBoxState)

Belirtilen durumda ve konumda, belirtilen metin ve metin biçimlendirmesiyle ve isteğe bağlı bir odak dikdörtgeniyle bir onay kutusu denetimi çizer.

DrawCheckBox(Graphics, Point, Rectangle, String, Font, Image, Rectangle, Boolean, CheckBoxState)

Belirtilen durumda ve konumda, belirtilen metin ve görüntüyle ve isteğe bağlı bir odak dikdörtgeniyle bir onay kutusu denetimi çizer.

DrawCheckBox(Graphics, Point, Rectangle, String, Font, TextFormatFlags, Image, Rectangle, Boolean, CheckBoxState)

Belirtilen durumda ve konumda bir onay kutusu denetimi çizer; belirtilen metin, metin biçimlendirmesi ve resimle; ve isteğe bağlı bir odak dikdörtgeni ile.

DrawCheckBox(Graphics, Point, CheckBoxState)

Belirtilen durumda ve konumda bir onay kutusu denetimi çizer.

public:
 static void DrawCheckBox(System::Drawing::Graphics ^ g, System::Drawing::Point glyphLocation, System::Windows::Forms::VisualStyles::CheckBoxState state);
public static void DrawCheckBox (System.Drawing.Graphics g, System.Drawing.Point glyphLocation, System.Windows.Forms.VisualStyles.CheckBoxState state);
static member DrawCheckBox : System.Drawing.Graphics * System.Drawing.Point * System.Windows.Forms.VisualStyles.CheckBoxState -> unit
Public Shared Sub DrawCheckBox (g As Graphics, glyphLocation As Point, state As CheckBoxState)

Parametreler

g
Graphics

Onay Graphics kutusunu çizmek için kullanılır.

glyphLocation
Point

Point onay kutusu karakteri çizin.

state
CheckBoxState

CheckBoxState Onay kutusunun görsel durumunu belirten değerlerden biri.

Açıklamalar

İşletim sisteminde görsel stiller etkinleştirilirse ve görsel stiller geçerli uygulamaya uygulanırsa, bu yöntem geçerli görsel stiliyle onay kutusunu çizer. Aksi takdirde, onay kutusunu klasik Windows stiliyle çizer.

Şunlara uygulanır

DrawCheckBox(Graphics, Point, Rectangle, String, Font, Boolean, CheckBoxState)

Belirtilen durumda ve konumda, belirtilen metinle ve isteğe bağlı bir odak dikdörtgeniyle bir onay kutusu denetimi çizer.

public:
 static void DrawCheckBox(System::Drawing::Graphics ^ g, System::Drawing::Point glyphLocation, System::Drawing::Rectangle textBounds, System::String ^ checkBoxText, System::Drawing::Font ^ font, bool focused, System::Windows::Forms::VisualStyles::CheckBoxState state);
public static void DrawCheckBox (System.Drawing.Graphics g, System.Drawing.Point glyphLocation, System.Drawing.Rectangle textBounds, string checkBoxText, System.Drawing.Font font, bool focused, System.Windows.Forms.VisualStyles.CheckBoxState state);
public static void DrawCheckBox (System.Drawing.Graphics g, System.Drawing.Point glyphLocation, System.Drawing.Rectangle textBounds, string? checkBoxText, System.Drawing.Font? font, bool focused, System.Windows.Forms.VisualStyles.CheckBoxState state);
static member DrawCheckBox : System.Drawing.Graphics * System.Drawing.Point * System.Drawing.Rectangle * string * System.Drawing.Font * bool * System.Windows.Forms.VisualStyles.CheckBoxState -> unit
Public Shared Sub DrawCheckBox (g As Graphics, glyphLocation As Point, textBounds As Rectangle, checkBoxText As String, font As Font, focused As Boolean, state As CheckBoxState)

Parametreler

g
Graphics

Onay Graphics kutusunu çizmek için kullanılır.

glyphLocation
Point

Point onay kutusu karakteri çizin.

textBounds
Rectangle

Çizecek Rectangle checkBoxText olan.

checkBoxText
String

Çizecek String onay kutusu.

font
Font

Font için geçerli olacaktırcheckBoxText.

focused
Boolean

true odak dikdörtgeni çizmek için; aksi takdirde , false.

state
CheckBoxState

CheckBoxState Onay kutusunun görsel durumunu belirten değerlerden biri.

Açıklamalar

İşletim sisteminde görsel stiller etkinleştirilirse ve görsel stiller geçerli uygulamaya uygulanırsa, bu yöntem geçerli görsel stiliyle onay kutusunu çizer. Aksi takdirde, onay kutusunu klasik Windows stiliyle çizer.

Şunlara uygulanır

DrawCheckBox(Graphics, Point, Rectangle, String, Font, TextFormatFlags, Boolean, CheckBoxState)

Belirtilen durumda ve konumda, belirtilen metin ve metin biçimlendirmesiyle ve isteğe bağlı bir odak dikdörtgeniyle bir onay kutusu denetimi çizer.

public:
 static void DrawCheckBox(System::Drawing::Graphics ^ g, System::Drawing::Point glyphLocation, System::Drawing::Rectangle textBounds, System::String ^ checkBoxText, System::Drawing::Font ^ font, System::Windows::Forms::TextFormatFlags flags, bool focused, System::Windows::Forms::VisualStyles::CheckBoxState state);
public static void DrawCheckBox (System.Drawing.Graphics g, System.Drawing.Point glyphLocation, System.Drawing.Rectangle textBounds, string checkBoxText, System.Drawing.Font font, System.Windows.Forms.TextFormatFlags flags, bool focused, System.Windows.Forms.VisualStyles.CheckBoxState state);
public static void DrawCheckBox (System.Drawing.Graphics g, System.Drawing.Point glyphLocation, System.Drawing.Rectangle textBounds, string? checkBoxText, System.Drawing.Font? font, System.Windows.Forms.TextFormatFlags flags, bool focused, System.Windows.Forms.VisualStyles.CheckBoxState state);
static member DrawCheckBox : System.Drawing.Graphics * System.Drawing.Point * System.Drawing.Rectangle * string * System.Drawing.Font * System.Windows.Forms.TextFormatFlags * bool * System.Windows.Forms.VisualStyles.CheckBoxState -> unit
Public Shared Sub DrawCheckBox (g As Graphics, glyphLocation As Point, textBounds As Rectangle, checkBoxText As String, font As Font, flags As TextFormatFlags, focused As Boolean, state As CheckBoxState)

Parametreler

g
Graphics

Onay Graphics kutusunu çizmek için kullanılır.

glyphLocation
Point

Point onay kutusu karakteri çizin.

textBounds
Rectangle

Çizecek Rectangle checkBoxText olan.

checkBoxText
String

Çizecek String onay kutusu.

font
Font

Font için geçerli olacaktırcheckBoxText.

flags
TextFormatFlags

Değerlerin bit düzeyinde birleşimi TextFormatFlags .

focused
Boolean

true odak dikdörtgeni çizmek için; aksi takdirde , false.

state
CheckBoxState

CheckBoxState Onay kutusunun görsel durumunu belirten değerlerden biri.

Örnekler

Aşağıdaki kod örneği, fare işaretçisinin DrawCheckBox(Graphics, Point, Rectangle, String, Font, TextFormatFlags, Boolean, CheckBoxState) konumu tarafından belirlenen durumda bir onay kutusu çizmek için özel denetimin OnPaint yönteminde yöntemini kullanır. Bu kod örneği, sınıfı için CheckBoxRenderer sağlanan daha büyük bir örneğin parçasıdır.

// Draw the check box in the current state.
virtual void OnPaint(PaintEventArgs ^e) override
{
    Control::OnPaint(e);

    CheckBoxRenderer::DrawCheckBox(e->Graphics,
        ClientRectangle.Location, this->getTextRectangle(), this->Text,
        this->Font, TextFormatFlags::HorizontalCenter,
        clicked, state);
}


// Draw the check box in the checked or unchecked state, alternately.
virtual void OnMouseDown(MouseEventArgs ^e) override
{
    Control::OnMouseDown(e);

    if (!clicked)
    {
        clicked = true;
        this->Text = "Clicked!";
        state = CheckBoxState::CheckedPressed;
        Invalidate();
    }
    else
    {
        clicked = false;
        this->Text = "Click here";
        state = CheckBoxState::UncheckedNormal;
        Invalidate();
    }
}
// Draw the check box in the current state.
protected override void OnPaint(PaintEventArgs e)
{
    base.OnPaint(e);

    CheckBoxRenderer.DrawCheckBox(e.Graphics,
        ClientRectangle.Location, TextRectangle, this.Text,
        this.Font, TextFormatFlags.HorizontalCenter,
        clicked, state);
}

// Draw the check box in the checked or unchecked state, alternately.
protected override void OnMouseDown(MouseEventArgs e)
{
    base.OnMouseDown(e);

    if (!clicked)
    {
        clicked = true;
        this.Text = "Clicked!";
        state = CheckBoxState.CheckedPressed;
        Invalidate();
    }
    else
    {
        clicked = false;
        this.Text = "Click here";
        state = CheckBoxState.UncheckedNormal;
        Invalidate();
    }
}
' Draw the check box in the current state.
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
    MyBase.OnPaint(e)
    CheckBoxRenderer.DrawCheckBox(e.Graphics, _
        Me.ClientRectangle.Location, TextRectangle, Me.Text, _
        Me.Font, TextFormatFlags.HorizontalCenter, _
        clicked, state)
End Sub

' Draw the check box in the checked or unchecked state, alternately.
Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)
    MyBase.OnMouseDown(e)
    If Not clicked Then
        With Me
            .clicked = True
            .Text = "Clicked!"
            .state = CheckBoxState.CheckedPressed
        End With
        Invalidate()
    Else
        With Me
            .clicked = False
            .Text = "Click here"
            .state = CheckBoxState.UncheckedNormal
        End With
        Invalidate()
    End If
End Sub

Açıklamalar

İşletim sisteminde görsel stiller etkinleştirilirse ve görsel stiller geçerli uygulamaya uygulanırsa, bu yöntem geçerli görsel stiliyle onay kutusunu çizer. Aksi takdirde, onay kutusunu klasik Windows stiliyle çizer.

Şunlara uygulanır

DrawCheckBox(Graphics, Point, Rectangle, String, Font, Image, Rectangle, Boolean, CheckBoxState)

Belirtilen durumda ve konumda, belirtilen metin ve görüntüyle ve isteğe bağlı bir odak dikdörtgeniyle bir onay kutusu denetimi çizer.

public:
 static void DrawCheckBox(System::Drawing::Graphics ^ g, System::Drawing::Point glyphLocation, System::Drawing::Rectangle textBounds, System::String ^ checkBoxText, System::Drawing::Font ^ font, System::Drawing::Image ^ image, System::Drawing::Rectangle imageBounds, bool focused, System::Windows::Forms::VisualStyles::CheckBoxState state);
public static void DrawCheckBox (System.Drawing.Graphics g, System.Drawing.Point glyphLocation, System.Drawing.Rectangle textBounds, string checkBoxText, System.Drawing.Font font, System.Drawing.Image image, System.Drawing.Rectangle imageBounds, bool focused, System.Windows.Forms.VisualStyles.CheckBoxState state);
public static void DrawCheckBox (System.Drawing.Graphics g, System.Drawing.Point glyphLocation, System.Drawing.Rectangle textBounds, string? checkBoxText, System.Drawing.Font? font, System.Drawing.Image image, System.Drawing.Rectangle imageBounds, bool focused, System.Windows.Forms.VisualStyles.CheckBoxState state);
static member DrawCheckBox : System.Drawing.Graphics * System.Drawing.Point * System.Drawing.Rectangle * string * System.Drawing.Font * System.Drawing.Image * System.Drawing.Rectangle * bool * System.Windows.Forms.VisualStyles.CheckBoxState -> unit
Public Shared Sub DrawCheckBox (g As Graphics, glyphLocation As Point, textBounds As Rectangle, checkBoxText As String, font As Font, image As Image, imageBounds As Rectangle, focused As Boolean, state As CheckBoxState)

Parametreler

g
Graphics

Onay Graphics kutusunu çizmek için kullanılır.

glyphLocation
Point

Point onay kutusu karakteri çizin.

textBounds
Rectangle

Çizecek Rectangle checkBoxText olan.

checkBoxText
String

Çizecek String onay kutusu.

font
Font

Font için geçerli olacaktırcheckBoxText.

image
Image

Çizecek Image onay kutusu.

imageBounds
Rectangle

boyutlarını Rectangle temsil eden image.

focused
Boolean

true odak dikdörtgeni çizmek için; aksi takdirde , false.

state
CheckBoxState

CheckBoxState Onay kutusunun görsel durumunu belirten değerlerden biri.

Açıklamalar

İşletim sisteminde görsel stiller etkinleştirilirse ve görsel stiller geçerli uygulamaya uygulanırsa, bu yöntem geçerli görsel stiliyle onay kutusunu çizer. Aksi takdirde, onay kutusunu klasik Windows stiliyle çizer.

Şunlara uygulanır

DrawCheckBox(Graphics, Point, Rectangle, String, Font, TextFormatFlags, Image, Rectangle, Boolean, CheckBoxState)

Belirtilen durumda ve konumda bir onay kutusu denetimi çizer; belirtilen metin, metin biçimlendirmesi ve resimle; ve isteğe bağlı bir odak dikdörtgeni ile.

public:
 static void DrawCheckBox(System::Drawing::Graphics ^ g, System::Drawing::Point glyphLocation, System::Drawing::Rectangle textBounds, System::String ^ checkBoxText, System::Drawing::Font ^ font, System::Windows::Forms::TextFormatFlags flags, System::Drawing::Image ^ image, System::Drawing::Rectangle imageBounds, bool focused, System::Windows::Forms::VisualStyles::CheckBoxState state);
public static void DrawCheckBox (System.Drawing.Graphics g, System.Drawing.Point glyphLocation, System.Drawing.Rectangle textBounds, string checkBoxText, System.Drawing.Font font, System.Windows.Forms.TextFormatFlags flags, System.Drawing.Image image, System.Drawing.Rectangle imageBounds, bool focused, System.Windows.Forms.VisualStyles.CheckBoxState state);
public static void DrawCheckBox (System.Drawing.Graphics g, System.Drawing.Point glyphLocation, System.Drawing.Rectangle textBounds, string? checkBoxText, System.Drawing.Font? font, System.Windows.Forms.TextFormatFlags flags, System.Drawing.Image image, System.Drawing.Rectangle imageBounds, bool focused, System.Windows.Forms.VisualStyles.CheckBoxState state);
static member DrawCheckBox : System.Drawing.Graphics * System.Drawing.Point * System.Drawing.Rectangle * string * System.Drawing.Font * System.Windows.Forms.TextFormatFlags * System.Drawing.Image * System.Drawing.Rectangle * bool * System.Windows.Forms.VisualStyles.CheckBoxState -> unit
Public Shared Sub DrawCheckBox (g As Graphics, glyphLocation As Point, textBounds As Rectangle, checkBoxText As String, font As Font, flags As TextFormatFlags, image As Image, imageBounds As Rectangle, focused As Boolean, state As CheckBoxState)

Parametreler

g
Graphics

Onay Graphics kutusunu çizmek için kullanılır.

glyphLocation
Point

Point onay kutusu karakteri çizin.

textBounds
Rectangle

Çizecek Rectangle checkBoxText olan.

checkBoxText
String

Çizecek String onay kutusu.

font
Font

Font için geçerli olacaktırcheckBoxText.

flags
TextFormatFlags

Değerlerin bit düzeyinde birleşimi TextFormatFlags .

image
Image

Çizecek Image onay kutusu.

imageBounds
Rectangle

boyutlarını Rectangle temsil eden image.

focused
Boolean

true odak dikdörtgeni çizmek için; aksi takdirde , false.

state
CheckBoxState

CheckBoxState Onay kutusunun görsel durumunu belirten değerlerden biri.

Açıklamalar

İşletim sisteminde görsel stiller etkinleştirilirse ve görsel stiller geçerli uygulamaya uygulanırsa, bu yöntem geçerli görsel stiliyle onay kutusunu çizer. Aksi takdirde, onay kutusunu klasik Windows stiliyle çizer.

Şunlara uygulanır