摘要: 属性--Properties--UseSystemPasswordChar设置为true 阅读全文
posted @ 2017-09-17 22:15 孤夏 阅读(2243) 评论(0) 推荐(0) 编辑
摘要: 例:只允许输入4位数字 第一步 第二部 例:只允许IP格式 设置Mask属性项的EditMask属性值为:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0 阅读全文
posted @ 2017-09-17 22:13 孤夏 阅读(2715) 评论(0) 推荐(0) 编辑
摘要: 设置水印与消除水印 测试代码 阅读全文
posted @ 2017-09-17 21:38 孤夏 阅读(1171) 评论(0) 推荐(0) 编辑
摘要: static class Program { /// /// 应用程序的主入口点。 /// [STAThread] static void Main() { try { //设置应用程序处理异常方式:Threa... 阅读全文
posted @ 2017-09-17 17:32 孤夏 阅读(6000) 评论(1) 推荐(2) 编辑
摘要: /// /// 验证是否为纯数字 /// /// /// public static bool IsNumeric(string str) { if (str == null || str.Length == 0) return fals... 阅读全文
posted @ 2017-08-22 15:07 孤夏 阅读(941) 评论(0) 推荐(0) 编辑
摘要: OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "Microsoft Excel files(*.xls)|*.xls;*.xlsx";//过滤一下,只要表格格式的 openFileDialog.InitialDirectory = "c:\... 阅读全文
posted @ 2017-08-22 15:03 孤夏 阅读(383) 评论(0) 推荐(0) 编辑
摘要: DataTable dt = (DataTable)dgv.DataSource; dt.Rows.Clear(); dgv.DataSource = dt; 阅读全文
posted @ 2017-08-22 15:03 孤夏 阅读(124) 评论(0) 推荐(0) 编辑
摘要: winform程序一般是不允许非主线程操作ui,单可以通过线程与委托的方式并结合Control类提供的BeginInvoke机制进行ui更改 如下,这是更新ui的方法 1:创建委托 2:给委托添加方法 3:创建invoke方法 4.创建线程 阅读全文
posted @ 2017-07-13 17:05 孤夏 阅读(252) 评论(0) 推荐(0) 编辑
摘要: private void textBox1_KeyPress(object sender, KeyPressEventArgs e){ byte[] array = System.Text.Encoding.Default.GetBytes(e.KeyChar.ToString()); if (!c 阅读全文
posted @ 2017-07-11 16:19 孤夏 阅读(279) 评论(0) 推荐(0) 编辑
摘要: [DllImport("user32.dll")] public static extern bool ReleaseCapture(); [DllImport("user32.dll")] public static extern bool SendMessage(IntPtr hwnd, int 阅读全文
posted @ 2017-07-11 16:11 孤夏 阅读(440) 评论(0) 推荐(0) 编辑