随笔分类 -  WinForms

摘要:首先设置KeyPreview = true; Ctrl+V if (e.Modifiers == Keys.Control && e.KeyCode == Keys.V) { MessageBox.Show("Test"); } Ctrl+Alt+B private void Form1_KeyDo 阅读全文
posted @ 2020-09-09 14:45 Kyle0418 阅读(229) 评论(0) 推荐(0) 编辑
摘要:public Form1() { InitializeComponent(); backgroundWorker1.DoWork += BackgroundWorker1_DoWork; backgroundWorker1.RunWorkerCompleted += BackgroundWorker 阅读全文
posted @ 2020-03-30 16:30 Kyle0418 阅读(259) 评论(0) 推荐(1) 编辑
摘要:protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { Pen pen = new Pen(drawLineColor); pen.Width = 2; // 绘制一条水平分割线 e.Graphics.Draw 阅读全文
posted @ 2019-09-25 13:13 Kyle0418 阅读(428) 评论(1) 推荐(0) 编辑
摘要:[STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); _hookID = SetHook(_proc); For 阅读全文
posted @ 2019-08-22 10:43 Kyle0418 阅读(321) 评论(1) 推荐(1) 编辑
摘要:测试结果: 阅读全文
posted @ 2019-07-23 16:58 Kyle0418 阅读(403) 评论(0) 推荐(1) 编辑
摘要:// 首先开启smtp服务 try { MailMessage message = new MailMessage(); SmtpClient smtp = new SmtpClient(); message.From = new MailAddress("from@domain.com"); me 阅读全文
posted @ 2019-07-03 10:54 Kyle0418 阅读(127) 评论(0) 推荐(0) 编辑
摘要:public partial class Form1 : Form { public Form1() { InitializeComponent(); PanelEnhanced panelEnhanced = new PanelEnhanced(); this.Controls.Add(panel 阅读全文
posted @ 2019-05-27 15:50 Kyle0418 阅读(255) 评论(0) 推荐(0) 编辑
摘要:建议使用dll减少闪烁, 处理WM_NCHITTEST消息, 阅读全文
posted @ 2019-05-27 14:39 Kyle0418 阅读(386) 评论(0) 推荐(0) 编辑
摘要:chart1.Titles.Add("Line Chart"); chart1.ChartAreas[0].Axes[0].MajorGrid.Enabled = false; chart1.ChartAreas[0].Axes[1].MajorGrid.Enabled = false;this.d 阅读全文
posted @ 2019-05-21 09:57 Kyle0418 阅读(938) 评论(0) 推荐(0) 编辑
摘要:namespace WindowsFormsApp1 { public partial class Form2 : Form { private readonly BindingSource _bindingSource = new BindingSource(); public Form2() { 阅读全文
posted @ 2019-04-26 17:06 Kyle0418 阅读(2274) 评论(0) 推荐(0) 编辑
摘要:在“Program.cs”中添加以下代码: 测试结果: 阅读全文
posted @ 2019-04-25 14:03 Kyle0418 阅读(182) 评论(0) 推荐(0) 编辑
摘要:string constr = @"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=Test;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertifi 阅读全文
posted @ 2019-03-29 14:18 Kyle0418 阅读(167) 评论(0) 推荐(0) 编辑
摘要:或着, 阅读全文
posted @ 2019-03-20 14:00 Kyle0418 阅读(472) 评论(0) 推荐(0) 编辑
摘要:We can register the events "CellBeginEdit", "CellValidating" and "CellEndEdit" at the same time to get the two values before and after the modificatio 阅读全文
posted @ 2019-03-07 16:34 Kyle0418 阅读(762) 评论(0) 推荐(1) 编辑
摘要:Or 阅读全文
posted @ 2019-03-07 16:15 Kyle0418 阅读(502) 评论(0) 推荐(0) 编辑
摘要:String Path = "C:\\Test"; private void ListDirectory(TreeView treeView, string path) { treeView.Nodes.Clear(); var rootDirectoryInfo = new DirectoryIn 阅读全文
posted @ 2019-03-01 15:15 Kyle0418 阅读(405) 评论(0) 推荐(0) 编辑
摘要:from1.cs: config.xml: Result: 阅读全文
posted @ 2019-02-21 15:56 Kyle0418 阅读(507) 评论(0) 推荐(0) 编辑
摘要:分页: 阅读全文
posted @ 2019-02-19 15:17 Kyle0418 阅读(266) 评论(0) 推荐(0) 编辑
摘要:触发事件,修改”dgv-txt“中的值, 阅读全文
posted @ 2019-02-13 15:00 Kyle0418 阅读(1511) 评论(0) 推荐(1) 编辑
摘要:Result: 阅读全文
posted @ 2019-02-12 15:40 Kyle0418 阅读(430) 评论(0) 推荐(0) 编辑

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