Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tab character in a multiline text edit field?

13 views
Skip to first unread message

Morten Aune Lyrstad

unread,
Jul 5, 2004, 6:15:50 PM7/5/04
to
Hi! This is probably a stupid, question, but: When creating a dialog with a
multiline text edit field, I am unable to make the field insert the tab
character when I press the tab key, it only selects all text. Or rather, it
wants to go to the next control, but as the edit field is the only
control... well, you know what I mean. This should be a normal text-file
editor. What to do about this?

Hoping for a quick response,
Morten


Jeff Partch [MVP]

unread,
Jul 5, 2004, 9:45:39 PM7/5/04
to
"Morten Aune Lyrstad" <t...@much.spam> wrote in message
news:qqkGc.61$GY2....@juliett.dax.net...

You're going to have to subclass it and intercept (as in never let the base
class see it) the WM_GETDLGCODE message. To reimplement it, you can
basically follow the description of the message under "Edit Control Default
Message Processing" at this URL...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/editcontrols/abouteditcontrols.asp

...Always return the basic flags:
DLGC_WANTARROWS|DLGC_WANTCHARS|DLGC_HASSETSEL|DLGC_WANTALLKEYS. When the
(LPMSG)(LPARAM) from GetCurrentMessage()->lParam is non-NULL and
WM_SYSKEYDOWN/VK_BACK add the DLGC_WANTMESSAGE flag. Additionally, add a
check for WM_KEYDOWN/VK_TAB and add the DLGC_WANTTAB flag.

--
Jeff Partch [VC++ MVP]


Morten Aune Lyrstad

unread,
Jul 6, 2004, 4:48:20 AM7/6/04
to
Bingo! :-) Thanks alot!


0 new messages