SunnyUI/docs/UIRadioButton.md
2024-09-24 22:08:38 +08:00

47 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# UIRadioButton
---
- **UIRadioButton**
单选框。
- 默认属性Checked
- 默认事件CheckedChanged
- 属性列表
| 属性 | 说明 | 类型 | 默认值 |
|-----------|--------|--------|-------|
| Style | 主题样式 | UIStyle | Blue |
| StyleCustomMode | 获取或设置可以自定义主题风格 | bool | false |
| Checked|是否选中 | bool| false|
| Text |获取或设置显示的文本 | string | - |
| GroupIndex|分组编号 | int| 0 |
| AutoSize|自动大小 | bool| true |
| ImageSize|图标大小 | int| 16 |
| ImageInterval|图标与文字之间间隔| int| 3 |
| ReadOnly|是否只读| bool| false |
| ForeColor | 字体颜色 | Color | - |
| RadioButtonColor| 填充颜色 | Color | - |
| TagString | 获取或设置包含有关控件的数据的对象字符串 | string | - |
| Version | 版本 | string | - |
- 事件
CheckedChanged
public event EventHandler CheckedChanged;
参数sender当前控件
ValueChanged
public delegate void OnValueChanged(object sender, bool value);
参数sender当前控件
参数value选中值Checked
- 分组编号
在同一个容器中多个UIRadioButton可以根据GroupIndex进行分组同一个GroupIndex的只能选中一个
![输入图片说明](./assets/142906_320a5458_416720.png)
- 示例
![输入图片说明](./assets/142752_85484bd2_416720.png)