win32 api 编辑控件无法选择或编辑 [英] win32 api edit control can't be selected or edited
问题描述
我使用 win32 api 创建了一个编辑控件,如下所示:
I created an edit control using win32 api like this:
CreateWindow("编辑", "", WS_CHILD |WS_VISIBLE, 0, m_position,CONTROLS_WIDTH、EDITBOX_HEIGHT、m_editorWindow,(HMENU)GetNextComponentID(),m_instance, NULL)
CreateWindow("edit", "", WS_CHILD | WS_VISIBLE, 0, m_position, CONTROLS_WIDTH, EDITBOX_HEIGHT, m_editorWindow, (HMENU)GetNextComponentID(), m_instance, NULL)
我可以使用 SetWindowText 更改其中的文本,但我无法选择它或编辑它的内容 - 这是否是编辑控件的目的?:))
I can change the text from it using SetWindowText, but I can't select it or edit it's content - this is the purpose of an edit control, or not?:))
我在 MSDN 上阅读 http://msdn.microsoft.com/en-us/library/bb775458%28VS.85%29.aspx 我必须使用 Edit_enable 但我不知道在哪里可以找到瘦宏,我也不知道如何启用编辑.当我将光标移到它上面时,光标会变为标准编辑光标.
I read on MSDN http://msdn.microsoft.com/en-us/library/bb775458%28VS.85%29.aspx that I must use Edit_enable but I don't know where to find thin macro and I don't heave any idea how to enable editing. When I move the cursor over it the cursor changes to standard edit cursor.
感谢您的帮助!
推荐答案
它与 SetFocus(hwnd)
函数一起使用.
It works with SetFocus(hwnd)
function.
这篇关于win32 api 编辑控件无法选择或编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!