随笔分类 - WinForms
摘要:首先设置KeyPreview = true; Ctrl+V if (e.Modifiers == Keys.Control && e.KeyCode == Keys.V) { MessageBox.Show("Test"); } Ctrl+Alt+B private void Form1_KeyDo
阅读全文
摘要:public Form1() { InitializeComponent(); backgroundWorker1.DoWork += BackgroundWorker1_DoWork; backgroundWorker1.RunWorkerCompleted += BackgroundWorker
阅读全文
摘要:protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { Pen pen = new Pen(drawLineColor); pen.Width = 2; // 绘制一条水平分割线 e.Graphics.Draw
阅读全文
摘要:[STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); _hookID = SetHook(_proc); For
阅读全文
摘要:// 首先开启smtp服务 try { MailMessage message = new MailMessage(); SmtpClient smtp = new SmtpClient(); message.From = new MailAddress("from@domain.com"); me
阅读全文
摘要:public partial class Form1 : Form { public Form1() { InitializeComponent(); PanelEnhanced panelEnhanced = new PanelEnhanced(); this.Controls.Add(panel
阅读全文
摘要:建议使用dll减少闪烁, 处理WM_NCHITTEST消息,
阅读全文
摘要:chart1.Titles.Add("Line Chart"); chart1.ChartAreas[0].Axes[0].MajorGrid.Enabled = false; chart1.ChartAreas[0].Axes[1].MajorGrid.Enabled = false;this.d
阅读全文
摘要:namespace WindowsFormsApp1 { public partial class Form2 : Form { private readonly BindingSource _bindingSource = new BindingSource(); public Form2() {
阅读全文
摘要:在“Program.cs”中添加以下代码: 测试结果:
阅读全文
摘要:string constr = @"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=Test;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertifi
阅读全文
摘要:We can register the events "CellBeginEdit", "CellValidating" and "CellEndEdit" at the same time to get the two values before and after the modificatio
阅读全文
摘要:String Path = "C:\\Test"; private void ListDirectory(TreeView treeView, string path) { treeView.Nodes.Clear(); var rootDirectoryInfo = new DirectoryIn
阅读全文
摘要:from1.cs: config.xml: Result:
阅读全文
摘要:触发事件,修改”dgv-txt“中的值,
阅读全文
摘要:Result:
阅读全文