博客
关于我
【C#】WF编程 设计窗体应用程序
阅读量:545 次
发布时间:2019-03-09

本文共 2795 字,大约阅读时间需要 9 分钟。

C# Windows Forms 应用程序示例
            using System;using System.Windows.Forms;
namespace WindowsFormsApp2
{
public partial class Form1 : Form
{
private string[] m = { "", "", "", "", "", "", "" };
public Form1()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void label2_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
string message = "系统:";
if (radioButton1.Checked) message += "Android";
if (radioButton2.Checked) message += "iOS";
if (radioButton3.Checked) message += "Win8";
if (radioButton4.Checked) message += "Others";
message += " 价格:";
if (radioButton5.Checked) message += "600元以内";
if (radioButton6.Checked) message += "600-1000";
if (radioButton7.Checked) message += "1001-1499";
if (radioButton8.Checked) message += "1500-2000";
message += " 运营商:";
if (radioButton9.Checked) message += "中国移动";
if (radioButton10.Checked) message += "中国电信";
if (radioButton11.Checked) message += "中国联通";
message += "\n我主要使用以下方式:";
for (int i = 0; i < 7; i++)
{
if (m[i] != "")
{
message += m[i] + " ";
}
}
MessageBox.Show(message, "显示结果");
}
private void checkBox_CheckedChanged(object sender, EventArgs e)
{
if (sender == checkBox1)
{
m[0] = checkBox1.Checked ? "短信" : "";
m[1] = checkBox1.Checked ? "QQ" : "";
m[2] = checkBox1.Checked ? "微信" : "";
m[3] = checkBox1.Checked ? "MSN" : "";
m[4] = checkBox1.Checked ? "Email" : "";
m[5] = checkBox1.Checked ? "iMessage" : "";
m[6] = checkBox1.Checked ? "传统邮件" : "";
}
}
}
}

转载地址:http://tdoiz.baihongyu.com/

你可能感兴趣的文章
NodeMCU教程 http请求获取Json中文乱码解决方案
查看>>
Nodemon 深入解析与使用
查看>>
NodeSession:高效且灵活的Node.js会话管理工具
查看>>
node~ http缓存
查看>>
node不是内部命令时配置node环境变量
查看>>
node中fs模块之文件操作
查看>>
Node中同步与异步的方式读取文件
查看>>
node中的get请求和post请求的不同操作【node学习第五篇】
查看>>
Node中的Http模块和Url模块的使用
查看>>
Node中自启动工具supervisor的使用
查看>>
Node入门之创建第一个HelloNode
查看>>
node全局对象 文件系统
查看>>
Node出错导致运行崩溃的解决方案
查看>>
Node响应中文时解决乱码问题
查看>>
node基础(二)_模块以及处理乱码问题
查看>>
node安装卸载linux,Linux运维知识之linux 卸载安装node npm
查看>>
node安装及配置之windows版
查看>>
Node实现小爬虫
查看>>
Node提示:error code Z_BUF_ERROR,error error -5,error zlib:unexpected end of file
查看>>
Node提示:npm does not support Node.js v12.16.3
查看>>