![]() |
| | #1 |
| Registered User Join Date: Mar 2002
Posts: 109
| Preventing the user from aligning text in an edit box left and right OK, here's my problem. I've got a regular window (made with CreateWindowEx) with a bunch of edit controls in a row (also made with CreateWindowEx in the first window's WM_CREATE) in each of which the user has to enter 0, 1 or 2 characters. To be able to do this at any kind of acceptable speed I want the user to be able to go to the next control by pressing Tab (like you would in a dialog) or Enter, or when there's already 2 characters in the box. I've managed to do the latter, but for the life of me I can't figure out how to catch an Enter, and I don't even know where to start looking for Tab. Here's the code I've got so far (still a little beefy for a forum post, but hey, it's Windows and I couldn't make it any shorter than this, sorry 'bout that) *code no longer necessary after edit* I've tried searching the MSDN for a few hours and read this tutorial http://winprog.org/tutorial/ (and the accompanying FAQ) several times over but came up blank; the only examples I found all applied to dialogs, not regular windows. Any help on how to get this (switching to the next control when the user presses enter or tab) to work or where to find out how would be greatly appreciated! (edit) Oops. I had the forum set to showing only posts one month old, so after checking what I thought were all posts I didn't think I needed to do a search. The question has already been answered more than adequately before by adrianxw: Edit Boxes My other question is still relevant though: Another little thing, is it possible to prevent the user to right-click on a control and align the text to the left or right? I've found on the MSDN how to catch the user doing this in the parent window, but can't figure out how to center it again after it's happened (there doesn't seem to be a function or message for that). Thanks in advance!
__________________ Typing stuff in Code::Blocks 8.02, compiling stuff with MinGW 3.4.5. Last edited by Boksha; 11-19-2005 at 01:21 PM. |
| Boksha is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Tab order in Tab Control | Halloko | Windows Programming | 2 | 05-08-2005 11:08 PM |
| Buttons + Edit Control | jay kay | Windows Programming | 6 | 03-09-2005 05:36 PM |
| Dialog Edit Control and Enter Key | Quantrizi | Windows Programming | 2 | 04-14-2004 07:59 AM |
| OpenGL and Windows | sean345 | Game Programming | 5 | 06-24-2002 10:14 PM |
| Tab Controls - API | -KEN- | Windows Programming | 7 | 06-02-2002 09:44 AM |