开发者

win32 api edit control can't be selected or edited

I created an edit control using win32 api like this:

CreateWindow("edit", "", WS_CHILD | WS_VISIBLE, 0, m_position, CONTROLS_WIDTH, EDITBOX_HEIGHT, m_editorWindow, (HMENU)GetNextComponentID(), m_instance, NULL)

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?:))

I read on MSDN http://msdn.microsoft.com/en-us/library/bb775458%28VS.85%29.aspx that I must use Edit_enable b开发者_运维百科ut 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.

Thank you for help!


Or you could try:

HWND myWindow = CreateWindow("edit", "", WS_CHILD | WS_VISIBLE, 0, m_position, CONTROLS_WIDTH, EDITBOX_HEIGHT, m_editorWindow, (HMENU)GetNextComponentID(), m_instance, NULL);

EnableWindow(myWindow, true);


It works with SetFocus(hwnd) function.


Have you tried:

GetDlgItem(EditControlID)->EnableWindow(TRUE);

lol Oops.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜