win32 select all on edit ctrl (textbox)

前端 未结 7 1222
孤街浪徒
孤街浪徒 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.

提交回复
热议问题