问题描述
我通过调用 CreateWindow
创建了一个窗口,并在其上放置了2个编辑控件。
编辑控件有 WS_TABSTOP
样式,已启用。我可以改变它的文本,但控件之间的导航TAB键没有工作。
I created a window by calling CreateWindow
, and put 2 edit controls on it.The edit controls had WS_TABSTOP
style, which was enabled. I could change its text, but navigation between controls by TAB key did not work.
我将此代码放入我的邮件循环中:
I put this code in my message loop:
MSG msg;
while ( GetMessage( &msg, NULL, 0, 0 ) )
{
if ( !msg.hwnd || !IsDialogMessage( msg.hwnd, &msg ) )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
}
$ b
Unfortunately, navigating by TAB did not work, edit controls didn't edit, and the only thing happened by pressing TAB was the selection of the text of first control. Can anybody help me?
推荐答案
您传递给IsDialogMessage的窗口句柄是您要浏览的类似对话框的窗口。您正在传递接收邮件的窗口,这可能是编辑控件,而不是顶层窗口。
The window handle you pass to IsDialogMessage is the dialog-like window you want to navigate through. You are passing the window that received the message, which is probably the edit control, not the top-level window.
这篇关于如何在TAB键的窗口中的控件之间导航?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!