How can I allow ctrl+a with TextBox in winform?

后端 未结 9 2467
春和景丽
春和景丽 2020-12-15 02:38

I\'m asking the question already asked (and even answered) here: Why are some textboxes not accepting Control + A shortcut to select all by default

But that answer d

9条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-15 03:14

    Like other answers indicate, Application.EnableVisualStyles() should be called. Also the TextBox.ShortcutsEnabled should be set to true. But if your TextBox.Multiline is enabled then Ctrl+A will not work (see MSDN documentation). Using RichTextBox instead will get around the problem.

提交回复
热议问题