问题描述
我是第一次使用C#语言使用Visual Studio。
Hi, I am first time to work with Visual Studio with language C#.
我有一个小项目,基于Windows窗体。我有一些问题:
1。如何通过组合Win + D来阻止我的工作从折叠(MinimizeBox)?
1. How can I blocking my working From collapsing (MinimizeBox) by combination Win+D ?
2。我想要克隆我的表格,之后我想关闭一些已打开的表格。
2. I whant to clone my Form and after this I whant to close some of opened Forms.
  我打开新表格:
I opening new Form by:
  MainForm new_form = new MainForm();
  new_form.Show();
  我关闭表格:
and I closing Form by:
  this.Close();
  但是,当我在第一次打开From时按下Close按钮时,它们将全部关闭。我如何只关闭当前的From?
But, when I push button Close on my first opened From, they are closing all. How can I close only currently From?
3。我正在使用RichTextBox进行文本编辑。如何使用热键,例如:Ctrl + B(粗体),Ctrl + U(下划线)和其他?
3. I am using RichTextBox for text redaction. How can I use hot-keys, such as: Ctrl+B (bold), Ctrl+U (underline) and others?
非常感谢您的帮助。
推荐答案
MainForm new_form = new MainForm();
new_form.Show();
new_form.FormClosed += delegate { this.Close(); };
this.Hide();
如果你有很多表格需要兼顾,你可能想要在你的第一个打开的表格中保留一份列表,这样你就不会实际关闭()你的第一张表格,直到列表中的所有其他表格都关闭。
If you have a lot of Forms to juggle, you may want to keep a List of them in your first opened Form, so that you don't actually Close() your first Form until all other Forms in the List are closed.
这篇关于Windows Forms C# - 阻止折叠,新表单,文本更改器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!