Loading...
Loading...
Compare original and translation side by side
using Syncfusion.Windows.Forms.Tools;
using System;
using System.Drawing;
using System.Windows.Forms;
public class RadioButtonExample : Form
{
private RadioButtonAdv radioButtonAdv1;
private RadioButtonAdv radioButtonAdv2;
private RadioButtonAdv radioButtonAdv3;
public RadioButtonExample()
{
// Create first radio button
radioButtonAdv1 = new RadioButtonAdv();
radioButtonAdv1.Text = "Option 1";
radioButtonAdv1.Location = new Point(20, 20);
radioButtonAdv1.Size = new Size(120, 21);
radioButtonAdv1.Style = RadioButtonAdvStyle.Office2016Colorful;
radioButtonAdv1.Checked = true;
// Create second radio button
radioButtonAdv2 = new RadioButtonAdv();
radioButtonAdv2.Text = "Option 2";
radioButtonAdv2.Location = new Point(20, 50);
radioButtonAdv2.Size = new Size(120, 21);
radioButtonAdv2.Style = RadioButtonAdvStyle.Office2016Colorful;
// Create third radio button
radioButtonAdv3 = new RadioButtonAdv();
radioButtonAdv3.Text = "Option 3";
radioButtonAdv3.Location = new Point(20, 80);
radioButtonAdv3.Size = new Size(120, 21);
radioButtonAdv3.Style = RadioButtonAdvStyle.Office2016Colorful;
// Add to form
this.Controls.Add(radioButtonAdv1);
this.Controls.Add(radioButtonAdv2);
this.Controls.Add(radioButtonAdv3);
this.Text = "RadioButtonAdv Example";
this.Size = new Size(300, 200);
}
}using Syncfusion.Windows.Forms.Tools;
using System;
using System.Drawing;
using System.Windows.Forms;
public class RadioButtonExample : Form
{
private RadioButtonAdv radioButtonAdv1;
private RadioButtonAdv radioButtonAdv2;
private RadioButtonAdv radioButtonAdv3;
public RadioButtonExample()
{
// Create first radio button
radioButtonAdv1 = new RadioButtonAdv();
radioButtonAdv1.Text = "Option 1";
radioButtonAdv1.Location = new Point(20, 20);
radioButtonAdv1.Size = new Size(120, 21);
radioButtonAdv1.Style = RadioButtonAdvStyle.Office2016Colorful;
radioButtonAdv1.Checked = true;
// Create second radio button
radioButtonAdv2 = new RadioButtonAdv();
radioButtonAdv2.Text = "Option 2";
radioButtonAdv2.Location = new Point(20, 50);
radioButtonAdv2.Size = new Size(120, 21);
radioButtonAdv2.Style = RadioButtonAdvStyle.Office2016Colorful;
// Create third radio button
radioButtonAdv3 = new RadioButtonAdv();
radioButtonAdv3.Text = "Option 3";
radioButtonAdv3.Location = new Point(20, 80);
radioButtonAdv3.Size = new Size(120, 21);
radioButtonAdv3.Style = RadioButtonAdvStyle.Office2016Colorful;
// Add to form
this.Controls.Add(radioButtonAdv1);
this.Controls.Add(radioButtonAdv2);
this.Controls.Add(radioButtonAdv3);
this.Text = "RadioButtonAdv Example";
this.Size = new Size(300, 200);
}
}// Create GroupBox for radio buttons
GroupBox groupBox = new GroupBox();
groupBox.Text = "Select Option";
groupBox.Location = new Point(10, 10);
groupBox.Size = new Size(200, 120);
// Create themed radio buttons
string[] options = { "Small", "Medium", "Large" };
int yPos = 20;
foreach (string option in options)
{
RadioButtonAdv radio = new RadioButtonAdv();
radio.Text = option;
radio.Location = new Point(10, yPos);
radio.Style = RadioButtonAdvStyle.Office2016Colorful;
radio.ThemesEnabled = true;
groupBox.Controls.Add(radio);
yPos += 30;
}
this.Controls.Add(groupBox);// Create GroupBox for radio buttons
GroupBox groupBox = new GroupBox();
groupBox.Text = "Select Option";
groupBox.Location = new Point(10, 10);
groupBox.Size = new Size(200, 120);
// Create themed radio buttons
string[] options = { "Small", "Medium", "Large" };
int yPos = 20;
foreach (string option in options)
{
RadioButtonAdv radio = new RadioButtonAdv();
radio.Text = option;
radio.Location = new Point(10, yPos);
radio.Style = RadioButtonAdvStyle.Office2016Colorful;
radio.ThemesEnabled = true;
groupBox.Controls.Add(radio);
yPos += 30;
}
this.Controls.Add(groupBox);RadioButtonAdv shadowRadio = new RadioButtonAdv();
shadowRadio.Text = "Important Option";
shadowRadio.TextShadow = true;
shadowRadio.ShadowColor = Color.Gold;
shadowRadio.ShadowOffset = new Point(2, 2);
shadowRadio.Font = new Font("Segoe UI", 10, FontStyle.Bold);
shadowRadio.Location = new Point(20, 20);RadioButtonAdv shadowRadio = new RadioButtonAdv();
shadowRadio.Text = "Important Option";
shadowRadio.TextShadow = true;
shadowRadio.ShadowColor = Color.Gold;
shadowRadio.ShadowOffset = new Point(2, 2);
shadowRadio.Font = new Font("Segoe UI", 10, FontStyle.Bold);
shadowRadio.Location = new Point(20, 20);RadioButtonAdv gradientRadio = new RadioButtonAdv();
gradientRadio.Text = "Premium Option";
// Gradient properties set via designer or property grid
// GradientStart, GradientEnd, GradientStyle
gradientRadio.Location = new Point(20, 20);RadioButtonAdv gradientRadio = new RadioButtonAdv();
gradientRadio.Text = "Premium Option";
// Gradient properties set via designer or property grid
// GradientStart, GradientEnd, GradientStyle
gradientRadio.Location = new Point(20, 20);| Property | Type | Description | When to Use |
|---|---|---|---|
| RadioButtonAdvStyle | Office2007, Metro, Office2016 variants | Apply modern themes |
| bool | Enable/disable theming | Control theme application |
| Office2007Theme | Blue, Silver, Black, Managed | Office2007 color variants |
| 属性 | 类型 | 描述 | 适用场景 |
|---|---|---|---|
| RadioButtonAdvStyle | Office2007、Metro、Office2016变体 | 应用现代化主题 |
| bool | 启用/禁用主题 | 控制主题应用 |
| Office2007Theme | 蓝色、银色、黑色、托管 | Office2007颜色变体 |
| Property | Type | Description | When to Use |
|---|---|---|---|
| bool | Enable text shadow effect | Add visual depth to text |
| Color | Shadow color | Customize shadow appearance |
| Point | Shadow position offset | Control shadow placement |
| bool | Enable text wrapping | Handle long text labels |
| 属性 | 类型 | 描述 | 适用场景 |
|---|---|---|---|
| bool | 启用文字阴影效果 | 为文字增加视觉深度 |
| Color | 阴影颜色 | 自定义阴影外观 |
| Point | 阴影位置偏移 | 控制阴影位置 |
| bool | 启用文字换行 | 处理长文本标签 |
| Property | Type | Description | When to Use |
|---|---|---|---|
| bool | Show/hide focus rectangle | Control focus indicator |
| bool | Auto-calculate height | Adjust to content size |
| Color | Background color | Custom backgrounds |
| Color | Text color | Custom text colors |
| 属性 | 类型 | 描述 | 适用场景 |
|---|---|---|---|
| bool | 显示/隐藏焦点框 | 控制焦点指示器 |
| bool | 自动计算高度 | 根据内容尺寸调整 |
| Color | 背景颜色 | 自定义背景 |
| Color | 文字颜色 | 自定义文字颜色 |
| Property | Type | Description | When to Use |
|---|---|---|---|
| bool | Fire OnClick event | Control click behavior |
| bool | Radio button state | Set default selection |
| 属性 | 类型 | 描述 | 适用场景 |
|---|---|---|---|
| bool | 触发OnClick事件 | 控制点击行为 |
| bool | 单选按钮状态 | 设置默认选中项 |
ThemesEnabled = trueStyleTextShadow = trueShadowColorShadowOffsetDrawFocusRectangle = falseAutoHeight = trueWrapTextThemesEnabled = trueStyleTextShadow = trueShadowColorShadowOffsetDrawFocusRectangle = falseAutoHeight = trueWrapText