Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
什么事件用于 Windows 窗体的最大化和最小化?我想在表单最大化并且来自最小化模式时显示消息框。
这是经过测试的代码
private void Form1_Resize(object sender, EventArgs e) { if (WindowState == FormWindowState.Minimized) { MessageBox.Show("Minimize"); } else if (WindowState == FormWindowState.Maximized) { MessageBox.Show("Maximize"); } }