摘要: private void Form1_Load(object sender, EventArgs e)//窗体加载 { ToolTip toolTip1 = new ToolTip(); // Set up the delays for the ToolTip. toolTip1.AutoPopDe 阅读全文
posted @ 2021-07-12 20:13 Cmale 阅读(305) 评论(0) 推荐(0) 编辑
摘要: Ctrl + M + O: 折叠所有方法 Ctrl + M + L: 展开所有方法 Ctrl + M + M: 折叠或者展开当前方法 Ctrl + K + D: 快速对齐代码 阅读全文
posted @ 2021-07-12 19:23 Cmale 阅读(138) 评论(0) 推荐(0) 编辑
摘要: //二进制在C#中无法直接表示,我们一般用0和1的字符串来表示一个数的二进制形式。比如4的二进制为“100”。下面介绍C#里面用于进制转换的方法。 //十进制转换为二进制(int-->string) System.Convert.ToString(d, 2);// d为int类型 以4为例,输出为1 阅读全文
posted @ 2021-07-12 11:32 Cmale 阅读(538) 评论(0) 推荐(0) 编辑
摘要: 引用: using System.Threading.Tasks; using System.Windows.Forms; public void DoDelay(double milliSecond)//延时函数 { int start = Environment.TickCount; while 阅读全文
posted @ 2021-07-10 10:36 Cmale 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 窗体卸载事件: private void Form1_FormClosing(object sender, FormClosingEventArgs e) { if (DialogResult.OK == MessageBox.Show("你确定要关闭应用程序吗?", "关闭提示", Message 阅读全文
posted @ 2021-07-09 18:41 Cmale 阅读(285) 评论(0) 推荐(0) 编辑
摘要: 前提:如果有几十上百个数字变量需要赋值(顺序性的),我们可以使用枚举,枚举类只需要赋值第一个变量,一般的,如果不指定第一个变量的初始值,都是从0开始的。 如下枚举一个星期的变量: enum week { /// <summary> /// 周一 /// </summary> mon = 1, /// 阅读全文
posted @ 2021-07-09 09:08 Cmale 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 窗体控件: 1、treeView1 2、button1(加载)、button2(保存) 窗体代码: 1 private void button1_Click(object sender, EventArgs e) 2 { 3 treeView1.Focus(); 4 string xmlFileNa 阅读全文
posted @ 2021-07-06 17:18 Cmale 阅读(759) 评论(0) 推荐(0) 编辑
摘要: 因为数据库内容包含“-”,所以提示错误,解决方案如下: 原来的查询语句:string strSql = "select * from S-8261D系列"; 更改后的查询语句:string strSql = "select * from `S-8261D`系列"; 1 string strSql = 阅读全文
posted @ 2021-07-05 11:50 Cmale 阅读(1242) 评论(0) 推荐(0) 编辑
摘要: 1 //连接数据库 2 string dbPath = @"Data Source=D:\sqlliteDb\Test.db;Version=3"; 3 string strSql = "select * from aaa"; 4 SQLiteConnection Conn = new SQLite 阅读全文
posted @ 2021-07-03 17:39 Cmale 阅读(1527) 评论(0) 推荐(0) 编辑