win32全选编辑ctrl(文本框) [英] win32 select all on edit ctrl (textbox)

查看:50
本文介绍了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 )

这篇关于win32全选编辑ctrl(文本框)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆