RadioButtonRenderer.DrawRadioButton Methode
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
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)
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
- 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)
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
- 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)
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
- 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)
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
- 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)
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
- 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.