摘要:
1. Windows Forms中禁用窗体的关闭按钮 添加必要的命名空间: using System.Runtime.InteropServices; 添加必要的常数和API函数的引用 private const int SC_CLOSE = 0xF060; private const int MF_ENABLED = 0x00000000; private const int MF_GRAYED... 阅读全文
摘要:
回车移动焦点1.普通控件(TextBox)(最好在父窗体中实现以下代码,然后子窗体继承父窗体实现该功能)①Form.KeyPreview属性设为True②在KeyPress事件中添加以下代码private void BaseForm_KeyPress(object sender, KeyPressEventArgs e){ if (e.KeyChar == (char)Keys.Return... 阅读全文