win32 select all on edit ctrl (textbox)

前端 未结 7 1218
孤街浪徒
孤街浪徒 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:23

    You could simply use EM_SETSEL message to the textbox,

    According to MSDN ,

    If the start is 0 and the end is –1, all the text in the edit control is selected. If the start is –1, any current selection is deselected.

    so,

    SendMessage(hwndEdit,EM_SETSEL,0,-1);
    

    Will work fine.

    0 讨论(0)
提交回复
热议问题