摘要:
添加引用 using System.Reflection;using System.Runtime.InteropServices;using System.Diagnostics; 调用DLL文件 [DllImport("User32.dll")]private static extern bool ShowWindowAsync(IntPtr hWnd, int cmdShow);[DllIm... 阅读全文
摘要:
在Form_Load中输入如下代码: foreach(Control ctrl in this.Controls) { if ((ctrl is TextBox) || (ctrl is ComboBox)) //如果文本框或下拉框放在组合框中,你应该用如groupBox1.TextBox { ctrl.KeyDown += new System.Windows.F... 阅读全文
摘要:
在窗体的类中声明两个变量 private Point mouseOffset; //记录鼠标指针的坐标private bool isMouseDown = false; //记录鼠标按键是否按下 创建该窗体 MouseDown事件的相应处理程序,注示部分为坐标的补偿 private void Form1_MouseDown(object sender, System.Windows.Forms.M... 阅读全文