摘要: //这里重点//在打开的窗口中查找about窗口Form test = Application.OpenForms["about"];//判断对应窗口是否被打开if ((test == null) || (test.IsDisposed)) { //如果没有打开 new一个窗口 about abou 阅读全文
posted @ 2020-04-13 08:50 baissy 阅读(1387) 评论(0) 推荐(0) 编辑
摘要: 【卸载】 不推荐使用控制面板-->卸载程序,来卸载,容易出现报错。 使用电脑管家卸载很轻松。 【删除注册列表】 HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\MySQLHKEY_LOCAL_MACHINE\ 阅读全文
posted @ 2019-12-03 11:38 baissy 阅读(1278) 评论(0) 推荐(0) 编辑
摘要: Invoke(new MethodInvoker(delegate { textBox1.Text = "修改了"; })); 在子线程中想要操作主线程中的变量值,可以通过此方法修改。 如:线程异步工作时,达到某个条件修改某个文本框中的内容。 上面是简单缩写,也可以写成: private void  阅读全文
posted @ 2019-11-23 16:29 baissy 阅读(517) 评论(0) 推荐(0) 编辑
摘要: 由于本着节约的原则,这里的打印都只是保存为.oxps格式的文件。 在我调试时每次打印完成后,窗体都会自己闪退。 在网上并没有相关资料,经过加入断点确认问题在 修改为 修改后不再崩溃。 阅读全文
posted @ 2019-10-23 09:27 baissy 阅读(1975) 评论(0) 推荐(0) 编辑
摘要: if (!(e.KeyChar >= '0' && e.KeyChar <= '9' || e.KeyChar == '.')) e.Handled = true; if (e.KeyChar == '\b') e.Handled = false; 阅读全文
posted @ 2019-10-23 09:05 baissy 阅读(1459) 评论(0) 推荐(0) 编辑
摘要: private string Notes = "提示文本"; private void textBox1_Leave(object sender, EventArgs e) { // 退出失去焦点,重新显示 if (string.IsNullOrEmpty(textBox1.Text)) { textBox1.ForeColor = Color.Dark... 阅读全文
posted @ 2019-10-23 09:01 baissy 阅读(5658) 评论(0) 推荐(2) 编辑
摘要: using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; namespace WGClient { class AutoSizeFormClass { //(1).声明结构,只记录窗体和其控件的初始位置和大小。 public struct controlRect { public int 阅读全文
posted @ 2019-10-23 08:57 baissy 阅读(4846) 评论(1) 推荐(1) 编辑
摘要: 公司一般都有通讯和住址的统计,但是文字化的表格根本就不知道住在哪。 用百度地图就可以轻松解决, 而且公司还经常人员变动,读取excel中的内容,就不用每次还要更改地图文件了。 在遇到需要聚餐在地图中标点时,在文本框中输入地址,多个地址需要用英文逗号“,”分割。 为了单个文件的方便,存放更雅观这里引用 阅读全文
posted @ 2019-06-12 15:28 baissy 阅读(831) 评论(0) 推荐(0) 编辑
摘要: 1 string path="指定路径"; 2 3 string filename =“需要查找的文件名.csv"; 4 5 List lineStringList = new List();//存储所有读取到的文件 6 7 DirectoryInfo[] dateDirArr = new DirectoryInfo(path).GetDirectories(); //取指定... 阅读全文
posted @ 2019-06-12 09:20 baissy 阅读(6713) 评论(0) 推荐(0) 编辑