I've a dialog box with 3 edit controls. I"m trying to get the TAB to work so I can move
from one edit box to the next. When the menu appears the cursor is at the start of
the first EDIT box. I can type date into the box and edit it etc, when I hit the TAB key
I get a beep. I can move the cursor to the other boxes via the mouse, but the TAB
key doesn't respond. I have NO code in my dialog box handler to handle a tab input
My dialog box styles in the resource script are:
ADDDIAG DIALOG,10,10,450,300
STYLE 0x0004|WS_CAPTION|WS_MINIMIZEBOX|WS_HSCROLL|WS_VSCROLL|
WS_SYSMENU|WS_VISIBLE|WS_OVERLAPPED|DS_MODALFRAME|WS_TABSTOP|
WS_3DLOOL
My EDIT box controls are
EDITTEXT IDD_AEDITN,200,20,150,10,ES_AUTOHSCROLL|ES_LEFT|WS_TABSTOP
EDITTEXT IDD_AEDITD,250,45,15,10,WS_TABSTOP
EDITTEXT IDD_AEDITM,270,45,15,10,WS_TABSTOP
EDITTEXT IDD_AEDITY,290,45,15,10,WS_TABSTOP

Any assistance would be greatly appreciated
BOBR
Posted on 2004-06-01 14:02:59 by bobr_bak
Are you processing the "IsDialogMessage" API function in your message loop?
For automatic keystroke handling, this API is required...


Remarks:

Although the IsDialogMessage function is intended for modeless dialog boxes, you can use it with any window that contains controls, enabling the windows to provide the same keyboard selection as is used in a dialog box.

When IsDialogMessage processes a message, it checks for keyboard messages and converts them into selection commands for the corresponding dialog box. For example, the TAB key, when pressed, selects the next control or group of controls, and the DOWN ARROW key, when pressed, selects the next control in a group.

Because the IsDialogMessage function performs all necessary translating and dispatching of messages, a message processed by IsDialogMessage must not be passed to the TranslateMessage or DispatchMessage function.


Of course if you *are* using this API, I have no clue whats wrong...
Posted on 2004-06-01 20:03:24 by Graebel
Afternoon, bobr.

I just did a test with the information you've supplied and came to the conclusion that WS_3DLOOL doesn't exist.

Using:


#include "\masm32\include\resource.h"

#define ADDDIAG 200
#define IDD_AEDITN 201
#define IDD_AEDITD 202
#define IDD_AEDITM 203
#define IDD_AEDITY 204

ADDDIAG DIALOG DISCARDABLE 10,10,450,300
STYLE 0x0004 | WS_CAPTION | WS_MINIMIZEBOX | WS_HSCROLL | WS_VSCROLL | WS_SYSMENU | WS_VISIBLE | WS_OVERLAPPED | DS_MODALFRAME | WS_TABSTOP
BEGIN

EDITTEXT IDD_AEDITN,200,20,150,10,ES_AUTOHSCROLL|ES_LEFT|WS_TABSTOP
EDITTEXT IDD_AEDITD,250,45,15,10,WS_TABSTOP
EDITTEXT IDD_AEDITM,270,45,15,10,WS_TABSTOP
EDITTEXT IDD_AEDITY,290,45,15,10,WS_TABSTOP

END

in your .rc file and:


...
ADDDIAG equ 200
IDD_AEDITN equ 201
IDD_AEDITD equ 202
IDD_AEDITM equ 203
IDD_AEDITY equ 204
...
invoke InitCommonControls

invoke DialogBoxParam,hInstance,ADDDIAG,0,ADDR WndProc,0
...

to call the dialog allows tabbing between editboxs as normal.

Cheers,
Scronty
Posted on 2004-06-02 06:29:55 by Scronty