当前位置:网站首页>The use of C# control CheckBox
The use of C# control CheckBox
2022-07-31 13:15:00 【dusk and starry sky】
Use the CheckBox control
Today, I used the CheckBox control, record it here.
Tools: Visual Studio 2017 (other versions also work)
Method/step:
1. Drag the CheckBox control to the window, as shown in the following figure:
2. Change the name of the control to CBox
3. Common methods of this control:
this.CheckBox.Checked = true; //Set the control state to checked
this.CheckBox.Checked= false; //Set the control state to unchecked
//or
this.CheckBox.CheckState = CheckState.Checked; //Set the control state to checked
this.CheckBox.CheckState =CheckState.Unchecked; //Set the control state to unchecked
4. How to judge the current state of the control
this.CBox.Checked
if(this.CBox.Checked==ture)
{
MessageBox.Show("Choose");
}
else
{
MessageBox.Show(“No Choose”);
}
5. Double-click the control, an event will be added (when the state of the control changes)
At this time, a function related to the attribute will be generated, and the related function can be realized by editing the function, as shown below:
private void CBox_CheckedChanged(object sender, EventArgs e){if (this.CBox.Checked == true){MessageBox.Show("Choose");}else{MessageBox.Show("No Choose");}}边栏推荐
- matlab as(assert dominance)
- Six Stones Programming: No matter which function you think is useless, people who can use it will not be able to leave, so at least 99%
- 战略进攻能力的重要性,要远远高于战略防守能力
- ASM module in SAP Ecommerce Cloud Spartacus UI and Accelerator UI
- C#Assembly的使用
- FastAPI 封装一个通用的response
- AMBA APB学习记录(AMBA 3/4)
- C# List用法 List介绍
- 攻防演练丨赛宁红方管控平台走进广东三地 助力数字政府网络安全建设
- 爱可可AI前沿推介(7.31)
猜你喜欢

Error: npm ERR code EPERM

【OpenCV】-边缘检测汇总示例

C#获得网卡信息 NetworkInterface IPInterfaceProperties

golang-gin - graceful restart

Network layer key protocol - IP protocol

Batch大小不一定是2的n次幂!ML资深学者最新结论

阿里三面:MQ 消息丢失、重复、积压问题,怎么解决?
![[CPU Design Practice] Simple Pipeline CPU Design](/img/83/e1dfedfe2b2cfe83a34f86e252caa7.jpg)
[CPU Design Practice] Simple Pipeline CPU Design

IDEA的database使用教程(使用mysql数据库)

golang八股文整理(持续搬运)
随机推荐
报错:npm ERR code EPERM
C#控件CheckBox的使用
【OpenCV】-边缘检测汇总示例
操作符详解
ECCV2022: Recursion on Transformer without adding parameters and less computation!
集群的安全模式
Centos7 install mysql5.7
The operator,
深入浅出边缘云 | 4. 生命周期管理
How to quickly split and merge cell data in Excel
IDEA的database使用教程(使用mysql数据库)
Spark学习:为Spark Sql添加自定义优化规则
关于MySQL主从复制的数据同步延迟问题
centos7安装mysql5.7
最新完整代码:使用word2vec预训练模型进行增量训练(两种保存方式对应的两种加载方式)适用gensim各种版本
EasyMock日记1[通俗易懂]
Ali on three sides: MQ message loss, repetition, backlog problem, how to solve?
golang-gin - graceful restart
关于我放弃考研这件事儿
SAP 电商云 Spartacus SSR Optimization Engine 几处 timeout 的执行顺序