随笔分类 -  winform

winform相关
摘要:首先,开始之前,需要知道作为.NET框架最重要的组件之一,ADO.NET扮演着应用程序与数据交互的重要的角色。 简单的讲,ADO.NET是一组允许.NET开发人员使用标准的,结构化的,甚至无连接的方式与数据交互的技术。对于ADO.NET来说,可以处理数据源是多样的。可以是应用程序唯一使用的创建在内存 阅读全文
posted @ 2023-04-20 17:53 Lee597 阅读(782) 评论(0) 推荐(0) 编辑
摘要:直接复制即可 #region 生成2位随机数 public double NextDouble(Random ran, double minValue, double maxValue, int decimalPlace) { double randNum = ran.NextDouble() * 阅读全文
posted @ 2022-01-22 11:49 Lee597 阅读(761) 评论(0) 推荐(0) 编辑
摘要:直接复制即可 #region 将秒转化成时分秒 /// <summary> /// 将int秒数转化成string时分秒 /// </summary> /// <param name="sec"></param> /// <returns></returns> private string SecT 阅读全文
posted @ 2022-01-22 11:47 Lee597 阅读(827) 评论(0) 推荐(0) 编辑
摘要:if ((int)MessageBox.Show("YES IS 1 ?", "BE SURE",MessageBoxButtons.OKCancel) == 1) { MessageBox.Show("1", "结果"); } 简单的就这一句,变形和延展的功能很多,自己改一下就可以了,很方便 阅读全文
posted @ 2022-01-22 11:44 Lee597 阅读(582) 评论(0) 推荐(0) 编辑
摘要:直接复制就行 路径就是一个完整路径,最好是@“”这样不容易错 文件类型直接打就可以了,比如 txt /// <summary> /// 寻找路径中,某文件类型的数量 /// </summary> /// <param name="Path">寻找路径</param> /// <param name= 阅读全文
posted @ 2022-01-22 11:42 Lee597 阅读(152) 评论(0) 推荐(0) 编辑
摘要:直接复制套用即可 注意点: 1、一个路径替换的时候,需要全部相同 2、加入表格的内容,如果要分格,一定要加逗号 3、如果是带入参数,一定是参数+","+参数的形式 private void Write() { if (File.Exists(@"一个路径" + DateTime.Now.ToStri 阅读全文
posted @ 2022-01-22 11:40 Lee597 阅读(250) 评论(0) 推荐(0) 编辑
摘要:1、定义 System.Timers.Timer ChangeUI_Timer = new System.Timers.Timer(); private delegate void myDelegate();//添加一个委托代理 int TimerLoad = 0; 2、Load部分 private 阅读全文
posted @ 2022-01-22 11:34 Lee597 阅读(245) 评论(0) 推荐(0) 编辑
摘要:首先在窗口应用的加载内容中,也就是窗口的 load 里加入启动时的预载内容 //设置时间间隔ms int interval = 1000; Mytimer = new System.Timers.Timer(interval); //设置重复计时 Mytimer.AutoReset = true; 阅读全文
posted @ 2021-12-30 12:22 Lee597 阅读(613) 评论(0) 推荐(0) 编辑
摘要:主要就是利用 Window API 来实现功能 学习了 https://blog.csdn.net/sunxiaotianmg/article/details/17136719 https://blog.csdn.net/tpstu/article/details/44566581 这两篇,讲的蛮不 阅读全文
posted @ 2021-08-23 14:49 Lee597 阅读(236) 评论(0) 推荐(0) 编辑
摘要:for (int i = 0; i < dataGridView.RowCount - 1; i++) //dataGridView.RowCount - 1 来获取列数,-1是因为第一列是标题一般 { try { //这些A、B、C等等,是用来存值,为以后SQL语句填值用,Row是行,Cell是列 阅读全文
posted @ 2021-08-12 20:01 Lee597 阅读(170) 评论(0) 推荐(0) 编辑
摘要:以前有过一篇类似的随笔,这次用法与上次不同 try { OpenFileDialog opXls = new OpenFileDialog(); opXls.Multiselect = false;//该值确定是否可以选择多个文件 // 指定打开文档的初始位置 opXls.InitialDirect 阅读全文
posted @ 2021-08-12 19:57 Lee597 阅读(187) 评论(0) 推荐(0) 编辑
摘要:#region 设置键盘控件,让键盘的回车也能触发确定按钮 protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (keyData == Keys.Enter) { //button1.Focus(); b 阅读全文
posted @ 2021-08-07 14:36 Lee597 阅读(184) 评论(0) 推荐(0) 编辑
摘要:记住是写在Programs.cs里面的,程序入口点如果不对,请自行修改using System;using System.Collections.Generic;using System.Linq;using System.Windows.Forms;using System.IO;using Wi 阅读全文
posted @ 2021-08-07 14:35 Lee597 阅读(273) 评论(0) 推荐(0) 编辑
摘要:这是当textBox7文本框中无内容时,才可以运行的,且还关联了一个button3,如不需要,都可以删除if (string.IsNullOrEmpty(textBox7.Text)) { //此时弹出一个可以选择文件的窗体 OpenFileDialog fileDialog = new OpenF 阅读全文
posted @ 2021-08-07 14:35 Lee597 阅读(168) 评论(0) 推荐(0) 编辑
摘要:打开界面时的隐藏,写于Form_A界面,要打开的是Form_B界面 Form_A界面中在触发事件里这样写:private void button1_Click(object sender, EventArgs e) { try { Form_B B = new Form_B(this); this. 阅读全文
posted @ 2021-08-07 14:35 Lee597 阅读(168) 评论(0) 推荐(0) 编辑
摘要:#region 点击右上角X按钮关闭事件 protected override void WndProc(ref Message msg) { const int WM_SYSCOMMAND = 0x0112; const int SC_CLOSE = 0xF060; // 点击winform右上关 阅读全文
posted @ 2021-08-07 14:34 Lee597 阅读(283) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;u 阅读全文
posted @ 2021-07-02 16:35 Lee597 阅读(127) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Data.OleDb;using System.Drawing;using System. 阅读全文
posted @ 2021-07-02 14:00 Lee597 阅读(411) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;u 阅读全文
posted @ 2021-07-02 11:33 Lee597 阅读(72) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Data.SqlClient;using System.Drawing;using Sys 阅读全文
posted @ 2021-07-02 11:32 Lee597 阅读(578) 评论(1) 推荐(0) 编辑

点击右上角即可分享
微信分享提示