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.
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.
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:
If it is neither of these post an example and I will take a look at it.
As a dialog box:
INVOKE DialogBoxParam,,1000,0,ADDR DlgProc,0
In the message loop for a dialog as window:
.WHILE TRUE
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
.ENDIF
.ENDW
If it is neither of these post an example and I will take a look at it.
Thank, that my problem, i fixed it.
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:
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:
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 :
In your case you would add "H" and check the Ctrl check box, then assign the key the same command ID as the button.
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
.WHILE TRUE
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
.ENDIF
.ENDIF
.ENDW
In your case you would add "H" and check the Ctrl check box, then assign the key the same command ID as the button.
TabIndex and Accelerator demo in my tutorial website now. (Tutorial 6) Link in my signature.