RadioButtonRenderer.DrawRadioButton Methode

Definitie

Hiermee tekent u een keuzerondje (ook wel keuzerondje genoemd).

Overloads

Name Description
DrawRadioButton(Graphics, Point, RadioButtonState)

Hiermee tekent u een keuzerondje (ook wel keuzerondje genoemd) in de opgegeven status en locatie.

DrawRadioButton(Graphics, Point, Rectangle, String, Font, Boolean, RadioButtonState)

Hiermee tekent u een keuzerondje (ook wel keuzerondje genoemd) in de opgegeven status en locatie, met de opgegeven tekst en met een optionele focusrechthoek.

DrawRadioButton(Graphics, Point, Rectangle, String, Font, TextFormatFlags, Boolean, RadioButtonState)

Hiermee tekent u een keuzerondje (ook wel keuzerondje genoemd) in de opgegeven status en locatie, met de opgegeven tekst- en tekstopmaak en met een optionele focusrechthoek.

DrawRadioButton(Graphics, Point, Rectangle, String, Font, Image, Rectangle, Boolean, RadioButtonState)

Hiermee tekent u een keuzerondje (ook wel keuzerondje genoemd) in de opgegeven status en locatie, met de opgegeven tekst en afbeelding en met een optionele focusrechthoek.

DrawRadioButton(Graphics, Point, Rectangle, String, Font, TextFormatFlags, Image, Rectangle, Boolean, RadioButtonState)

Hiermee tekent u een keuzerondje (ook wel keuzerondje genoemd) in de opgegeven status en locatie; met de opgegeven tekst, tekstopmaak en afbeelding; en met een optionele focusrechthoek.

DrawRadioButton(Graphics, Point, RadioButtonState)

Bron:
RadioButtonRenderer.cs
Bron:
RadioButtonRenderer.cs
Bron:
RadioButtonRenderer.cs
Bron:
RadioButtonRenderer.cs
Bron:
RadioButtonRenderer.cs

Hiermee tekent u een keuzerondje (ook wel keuzerondje genoemd) in de opgegeven status en locatie.

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

Parameters

g
Graphics

Hiermee Graphics tekent u de keuzerondje.

glyphLocation
Point

De Point knop om de optieknop te tekenen.

state
RadioButtonState

Een van de RadioButtonState waarden waarmee de visuele status van de keuzerondje wordt opgegeven.

Opmerkingen

Als visuele stijlen zijn ingeschakeld in het besturingssysteem en visuele stijlen worden toegepast op de huidige toepassing, tekent deze methode de optieknop met de huidige visuele stijl. Anders tekent deze methode de optieknop met de klassieke stijl Windows.

Van toepassing op

DrawRadioButton(Graphics, Point, Rectangle, String, Font, Boolean, RadioButtonState)

Bron:
RadioButtonRenderer.cs
Bron:
RadioButtonRenderer.cs
Bron:
RadioButtonRenderer.cs
Bron:
RadioButtonRenderer.cs
Bron:
RadioButtonRenderer.cs

Hiermee tekent u een keuzerondje (ook wel keuzerondje genoemd) in de opgegeven status en locatie, met de opgegeven tekst en met een optionele focusrechthoek.

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

Parameters

g
Graphics

Hiermee Graphics tekent u de keuzerondje.

glyphLocation
Point

De Point knop om de optieknop te tekenen.

textBounds
Rectangle

De Rectangle te tekenen radioButtonText .

radioButtonText
String

De String te tekenen met de optieknop.

font
Font

De Font toe te radioButtonTextpassen op .

focused
Boolean

true om een focusrechthoek te tekenen; anders, false.

state
RadioButtonState

Een van de RadioButtonState waarden waarmee de visuele status van de keuzerondje wordt opgegeven.

Voorbeelden

In het volgende codevoorbeeld wordt de methode in de DrawRadioButton(Graphics, Point, Rectangle, String, Font, Boolean, RadioButtonState) methode van OnPaint een aangepast besturingselement gebruikt om een optieknop te tekenen in de status die wordt bepaald door de locatie van de muisaanwijzer. Dit codevoorbeeld maakt deel uit van een groter voorbeeld voor de RadioButtonRenderer klasse.

    // Draw the radio button in the current state.
protected:
    virtual void OnPaint(PaintEventArgs^ e) override
    {
        __super::OnPaint(e);

        RadioButtonRenderer::DrawRadioButton(e->Graphics,
            ClientRectangle.Location, TextRectangle, this->Text,
            this->Font, clicked, state);
    }

    // Draw the radio button in the checked or unchecked state.
protected:
    virtual void OnMouseDown(MouseEventArgs^ e) override
    {
        __super::OnMouseDown(e);

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

    RadioButtonRenderer.DrawRadioButton(e.Graphics,
        ClientRectangle.Location, TextRectangle, this.Text,
        this.Font, clicked, state);
}

// Draw the radio button in the checked or unchecked state.
protected override void OnMouseDown(MouseEventArgs e)
{
    base.OnMouseDown(e);

    if (!clicked)
    {
        clicked = true;
        this.Text = "Clicked!";
        state = RadioButtonState.CheckedPressed;
        Invalidate();
    }
    else
    {
        clicked = false;
        this.Text = "Click here";
        state = RadioButtonState.UncheckedNormal;
        Invalidate();
    }
}
' Draw the radio button in the current state.
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
    MyBase.OnPaint(e)
    RadioButtonRenderer.DrawRadioButton(e.Graphics, _
        Me.ClientRectangle.Location, TextRectangle, Me.Text, _
        Me.Font, clicked, state)
End Sub

' Draw the radio button in the checked or unchecked state.
Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)
    MyBase.OnMouseDown(e)

    If Not clicked Then
        clicked = True
        Me.Text = "Clicked!"
        state = RadioButtonState.CheckedPressed
        Invalidate()
    Else
        clicked = False
        Me.Text = "Click here"
        state = RadioButtonState.UncheckedNormal
        Invalidate()
    End If

End Sub

Opmerkingen

Als visuele stijlen zijn ingeschakeld in het besturingssysteem en visuele stijlen worden toegepast op de huidige toepassing, tekent deze methode de optieknop met de huidige visuele stijl. Anders tekent deze methode de optieknop met de klassieke stijl Windows.

Van toepassing op

DrawRadioButton(Graphics, Point, Rectangle, String, Font, TextFormatFlags, Boolean, RadioButtonState)

Bron:
RadioButtonRenderer.cs
Bron:
RadioButtonRenderer.cs
Bron:
RadioButtonRenderer.cs
Bron:
RadioButtonRenderer.cs
Bron:
RadioButtonRenderer.cs

Hiermee tekent u een keuzerondje (ook wel keuzerondje genoemd) in de opgegeven status en locatie, met de opgegeven tekst- en tekstopmaak en met een optionele focusrechthoek.

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

Parameters

g
Graphics

Hiermee Graphics tekent u de keuzerondje.

glyphLocation
Point

De Point knop om de optieknop te tekenen.

textBounds
Rectangle

De Rectangle te tekenen radioButtonText .

radioButtonText
String

De String te tekenen met de optieknop.

font
Font

De Font toe te radioButtonTextpassen op .

flags
TextFormatFlags

Een bitsgewijze combinatie van de TextFormatFlags waarden.

focused
Boolean

true om een focusrechthoek te tekenen; anders, false.

state
RadioButtonState

Een van de RadioButtonState waarden waarmee de visuele status van de keuzerondje wordt opgegeven.

Opmerkingen

Als visuele stijlen zijn ingeschakeld in het besturingssysteem en visuele stijlen worden toegepast op de huidige toepassing, tekent deze methode de optieknop met de huidige visuele stijl. Anders tekent deze methode de optieknop met de klassieke stijl Windows.

Van toepassing op

DrawRadioButton(Graphics, Point, Rectangle, String, Font, Image, Rectangle, Boolean, RadioButtonState)

Bron:
RadioButtonRenderer.cs
Bron:
RadioButtonRenderer.cs
Bron:
RadioButtonRenderer.cs
Bron:
RadioButtonRenderer.cs
Bron:
RadioButtonRenderer.cs

Hiermee tekent u een keuzerondje (ook wel keuzerondje genoemd) in de opgegeven status en locatie, met de opgegeven tekst en afbeelding en met een optionele focusrechthoek.

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

Parameters

g
Graphics

Hiermee Graphics tekent u de keuzerondje.

glyphLocation
Point

De Point knop om de optieknop te tekenen.

textBounds
Rectangle

De Rectangle te tekenen radioButtonText .

radioButtonText
String

De String te tekenen met de optieknop.

font
Font

De Font toe te radioButtonTextpassen op .

image
Image

De Image te tekenen met de optieknop.

imageBounds
Rectangle

De Rectangle te tekenen image .

focused
Boolean

true om een focusrechthoek te tekenen; anders, false.

state
RadioButtonState

Een van de RadioButtonState waarden waarmee de visuele status van de keuzerondje wordt opgegeven.

Opmerkingen

Als visuele stijlen zijn ingeschakeld in het besturingssysteem en visuele stijlen worden toegepast op de huidige toepassing, tekent deze methode de optieknop met de huidige visuele stijl. Anders tekent deze methode de optieknop met de klassieke stijl Windows.

Van toepassing op

DrawRadioButton(Graphics, Point, Rectangle, String, Font, TextFormatFlags, Image, Rectangle, Boolean, RadioButtonState)

Bron:
RadioButtonRenderer.cs
Bron:
RadioButtonRenderer.cs
Bron:
RadioButtonRenderer.cs
Bron:
RadioButtonRenderer.cs
Bron:
RadioButtonRenderer.cs

Hiermee tekent u een keuzerondje (ook wel keuzerondje genoemd) in de opgegeven status en locatie; met de opgegeven tekst, tekstopmaak en afbeelding; en met een optionele focusrechthoek.

public:
 static void DrawRadioButton(System::Drawing::Graphics ^ g, System::Drawing::Point glyphLocation, System::Drawing::Rectangle textBounds, System::String ^ radioButtonText, System::Drawing::Font ^ font, System::Windows::Forms::TextFormatFlags flags, System::Drawing::Image ^ image, System::Drawing::Rectangle imageBounds, bool focused, System::Windows::Forms::VisualStyles::RadioButtonState state);
public static void DrawRadioButton(System.Drawing.Graphics g, System.Drawing.Point glyphLocation, System.Drawing.Rectangle textBounds, string radioButtonText, System.Drawing.Font font, System.Windows.Forms.TextFormatFlags flags, System.Drawing.Image image, System.Drawing.Rectangle imageBounds, bool focused, System.Windows.Forms.VisualStyles.RadioButtonState state);
public static void DrawRadioButton(System.Drawing.Graphics g, System.Drawing.Point glyphLocation, System.Drawing.Rectangle textBounds, string? radioButtonText, System.Drawing.Font? font, System.Windows.Forms.TextFormatFlags flags, System.Drawing.Image image, System.Drawing.Rectangle imageBounds, bool focused, System.Windows.Forms.VisualStyles.RadioButtonState state);
static member DrawRadioButton : 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.RadioButtonState -> unit
Public Shared Sub DrawRadioButton (g As Graphics, glyphLocation As Point, textBounds As Rectangle, radioButtonText As String, font As Font, flags As TextFormatFlags, image As Image, imageBounds As Rectangle, focused As Boolean, state As RadioButtonState)

Parameters

g
Graphics

Hiermee Graphics tekent u de keuzerondje.

glyphLocation
Point

De Point knop om de optieknop te tekenen.

textBounds
Rectangle

De Rectangle te tekenen radioButtonText .

radioButtonText
String

De String te tekenen met de optieknop.

font
Font

De Font toe te radioButtonTextpassen op .

flags
TextFormatFlags

Een bitsgewijze combinatie van de TextFormatFlags waarden.

image
Image

De Image te tekenen met de optieknop.

imageBounds
Rectangle

De Rectangle te tekenen image .

focused
Boolean

true om een focusrechthoek te tekenen; anders, false.

state
RadioButtonState

Een van de RadioButtonState waarden waarmee de visuele status van de keuzerondje wordt opgegeven.

Opmerkingen

Als visuele stijlen zijn ingeschakeld in het besturingssysteem en visuele stijlen worden toegepast op de huidige toepassing, tekent deze methode de optieknop met de huidige visuele stijl. Anders tekent deze methode de optieknop met de klassieke stijl Windows.

Van toepassing op