win32 select all on edit ctrl (textbox)

前端 未结 7 1223
孤街浪徒
孤街浪徒 2020-12-20 23:20

I am creating my textbox with these options. I can copy/cut/paste/undo, but when i hit select A it doesnt select all. I can right click and click select all but ctrl a doesn

7条回答
  •  感情败类
    2020-12-21 00:14

    You need to capture that keystroke and do the select all yourself.

    Here is some C# code for use with a RichTextBox:

        protected override void OnKeyDown(KeyEventArgs e)
        {
            // Ctrl-A does a Select All in the editor window
            if (e.Control && (e.KeyCode == Keys.A))
            {
                this.SelectAll();
                e.Handled = true;
            }
        }
    

    Sorry, I don't have Win32 code for you.

提交回复
热议问题