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