win32全选编辑ctrl(文本框)

问题描述:

我正在使用这些选项创建文本框.我可以复制/剪切/粘贴/撤消,但是当我点击 Select All 时,它并没有全部选中.我可以右键单击并单击全选,但是 CTRL + A 不会执行任何操作.为什么?

I am creating my textbox with these options. I can Copy / Cut / Paste / Undo, but when I hit Select All it doesn't select all. I can right click and click Select All but CTRL + A doesn't do anything. Why?

wnd = CreateWindow("EDIT", 0,
    WS_CHILD | WS_VISIBLE | ES_MULTILINE | WS_HSCROLL | WS_VSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL,
    x, y, w, h,
    parentWnd,
    NULL, NULL, NULL);

我倾向于使用MFC(请原谅我)而不是Win32,因此我无法确切地回答此问题,但是我注意到此注释添加到MS网站上有关以下内容的页面中与Edit控件(Edit控件内的一个简单编辑器)对话:

I tend to use MFC (forgive me) instead of Win32 so I cannot answer this definitively, but I noticed this comment added to a page on an MS site concerning talking with an Edit control (a simple editor within the Edit control):

编辑控件将 WM_CHAR 用于接受字符,而不是 WM_KEYDOWN 等等.您必须 Translate()消息,否则讽刺的是您不会能够在编辑中编辑文本控制.

The edit control uses WM_CHAR for accepting characters, not WM_KEYDOWN etc. You must Translate() your messages or you ironically won't be able to edit the text in the edit control.

我不知道这是否适用于BoltBait的回复,但我怀疑确实如此.

I don't know if this applies to BoltBait's response, but I suspect it does.

(我在 http://msdn.microsoft.com/en-us/library/bb775462(VS.85).aspx )