Hi Ketilo !

The TabIndex in propeties box at design dialogs not work, I've set tabindex of Textbox1 to 0, Textbox2 to 1 , Button1 to 2, when i compiled this project, at run time i can't use Tab button to move from one Cotrol to other control.
Posted on 2004-01-11 07:18:47 by neverending
Be sure that you are either using it as a dialog box or filtering with the IsDialogMessage function in your message loop for a dialog as window. The tab indexes work fine.

As a dialog box:

INVOKE DialogBoxParam,,1000,0,ADDR DlgProc,0

In the message loop for a dialog as window:


invoke GetMessage, ADDR msg,NULL,0,0
.BREAK .IF (!eax)
[b]invoke IsDialogMessage, hDlg, ADDR msg[/b]
.IF (!eax)
invoke TranslateMessage,addr msg
invoke DispatchMessage,addr msg

If it is neither of these post an example and I will take a look at it.
Posted on 2004-01-11 10:14:42 by donkey
Thank, that my problem, i fixed it.
Posted on 2004-01-12 04:19:57 by neverending
Hi !
I use Template DialogAsMain (MASM) , and this bug happen :
When i make a button and set caption to it : &Hello , then at runtime i press ALT+H to Execute command of this button but it's not work, can you help me to fix this bug again . :stupid:
Posted on 2004-01-14 08:42:29 by neverending
Everytime you do not know how to do something does not mean it is a bug, it just means you don't know how to do it. You must use an accelerator table for that:

In the Project menu is a selection Accelerator see the help file for how to add accelerators to your project. When you have the accelerator table added you can load it and process the messages for it this way in your dispatch loop :

invoke LoadAccelerators,hInstance,IDR_MAINACCEL

mov hAccel,eax

invoke GetMessage, ADDR msg,NULL,0,0
.BREAK .IF (!eax)
invoke TranslateAccelerator,hDlg,hAccel,ADDR msg
.IF (!eax)
invoke IsDialogMessage, msg.hwnd, ADDR msg
.IF eax ==FALSE
invoke TranslateMessage, ADDR msg
invoke DispatchMessage, ADDR msg

In your case you would add "H" and check the Ctrl check box, then assign the key the same command ID as the button.
Posted on 2004-01-14 08:59:27 by donkey
TabIndex and Accelerator demo in my tutorial website now. (Tutorial 6) Link in my signature.
Posted on 2004-01-27 09:55:38 by Ranma_at