28、C#里面的单选框RadioButton的属性和事件
来源:互联网 发布:led电子屏软件 编辑:程序博客网 时间:2024/06/07 19:10
在C#语言里面,单选框的属性和其它编程语言确实非常的相似。
主要的属性就是:Name、Text。事件主要的就是:CheckedChanged。
比如:创建一个简单的实例,选择春夏秋冬。就可以直接选中RadioButton组件,在窗口上面拉出4个单选框来。然后,分别修改Text属性为:春、夏、秋、冬。界面如下图:
接下来可以分别设置每个单选框组件的CheckedChanged事件。
代码如下:
void RadioButton1CheckedChanged(object sender, EventArgs e)
{
MessageBox.Show(radioButton1.Text);
}
void RadioButton2CheckedChanged(object sender, EventArgs e)
{
MessageBox.Show(radioButton2.Text);
}
void RadioButton3CheckedChanged(object sender, EventArgs e)
{
MessageBox.Show(radioButton3.Text);
}
void RadioButton4CheckedChanged(object sender, EventArgs e)
{
MessageBox.Show(radioButton4.Text);
}
- 28、C#里面的单选框RadioButton的属性和事件
- 26、C#里面标签的属性和事件
- 27、C#里面组合框ComboBox的属性和事件
- 29、C#里面多选框CheckBox的属性和事件
- 浅谈c#里面的属性
- abap table control里面各种属性和事件的写法
- abap table control里面各种属性和事件的写法
- abap table control里面各种属性和事件的写法
- abap table control里面各种属性和事件的写法
- abap table control里面各种属性和事件的写法
- abap table control里面各种属性和事件的写法
- android listview每个item里面有个radiobutton,怎么弄radibutton的单选事件
- radiobutton 的OnClickListener和OnCheckedChangeListener的响应事件分析
- RadioButton里面的文字对齐问题解决
- RadioButton和CheckBox的区别,RadioButton&RadioGroup
- UITableView里面的属性和方法总结
- android里面的一些属性和使用方法
- js里面的属性和方法类型
- 详解重写equals()方法就必须重写hashCode()方法的原因
- android 打包知识
- PixHawk学习笔记 之 源码浅析—mc_pos_control.cpp—do_control(dt)—control_non_manual(dt)
- JSONObject和JSONArray
- 求1!+2!+3!+……+20!的和
- 28、C#里面的单选框RadioButton的属性和事件
- 大数据竞赛平台——Kaggle 入门
- spring quartz 的用法
- 常用git命令
- 【正一专栏】曼城攻击力惊人露出冠军相
- Java 线程的6种状态
- web项目不能部署到本地tomcat?
- pandas随机选取若干行
- 使用graphviz画二叉树