C#winform多选框代码

cs 复制代码
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 多选
{
    public partial class Form1 : Form
    {
        string xueLI1;
        string nengLi1;
        string jingYan1;
        string checkBox11;
        public Form1()
        {
            InitializeComponent();
        }

        private void nengLi_CheckedChanged(object sender, EventArgs e)
        {
            if (nengLi.Checked == true) { nengLi1 = "有能力。\n"; }
            else { nengLi1 = ""; }
        }

        private void jingYan_CheckedChanged(object sender, EventArgs e)
        {
            if (jingYan .Checked == true) { jingYan1= "有经验。\n"; }
            else { jingYan1 = ""; }
        }

        private void xueLi_CheckedChanged(object sender, EventArgs e)
        {
            if (xueLi.Checked == true) { xueLI1 = "有学历。\n"; }
            else { xueLI1 = ""; }
        }

        private void queDing_Click(object sender, EventArgs e)
        {
            MessageBox.Show("我"+xueLI1+nengLi1+jingYan1+ checkBox11);
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBox1.Checked == true) { checkBox11 = "测试。\n"; }
            else { checkBox11 = ""; }
        }
    }
}

运行结果:

相关推荐
Scout-leaf3 天前
WPF新手村教程(三)—— 路由事件
c#·wpf
用户298698530143 天前
程序员效率工具:Spire.Doc如何助你一键搞定Word表格排版
后端·c#·.net
mudtools4 天前
搭建一套.net下能落地的飞书考勤系统
后端·c#·.net
玩泥巴的4 天前
搭建一套.net下能落地的飞书考勤系统
c#·.net·二次开发·飞书
唐宋元明清21885 天前
.NET 本地Db数据库-技术方案选型
windows·c#
郑州光合科技余经理5 天前
代码展示:PHP搭建海外版外卖系统源码解析
java·开发语言·前端·后端·系统架构·uni-app·php
lindexi5 天前
dotnet DirectX 通过可等待交换链降低输入渲染延迟
c#·directx·d2d·direct2d·vortice
feifeigo1235 天前
matlab画图工具
开发语言·matlab
dustcell.5 天前
haproxy七层代理
java·开发语言·前端
norlan_jame5 天前
C-PHY与D-PHY差异
c语言·开发语言