本文整理汇总了C#中System.Windows.Forms.RadioButtonRenderer.DrawRadioButton方法的典型用法代码示例。如果您正苦于以下问题:C# RadioButtonRenderer.DrawRadioButton方法的具体用法?C# RadioButtonRenderer.DrawRadioButton怎么用?C# RadioButtonRenderer.DrawRadioButton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.RadioButtonRenderer
的用法示例。
在下文中一共展示了RadioButtonRenderer.DrawRadioButton方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnPaint
// 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();
}
}