Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

tab order

Posted on 1998-07-16
3
Medium Priority
?
356 Views
Last Modified: 2008-02-01
I have  created a bunch of text fields, but I am having difficulting with the tab key.  I create the fields by using the
CreateWindow("EDIT, "", WS_CHILD | WS_BORDER | WS_VISIBLE | WS_TABSTOP, x,y,z, gMainWindow, NULL, ghInstance, NULL); call. I do this about twenty times, with twenty different sets of data then I store each Handle into an array.

FYI, When I run, It puts the focus into the first text field that I create, then when I press tab, nothing happens.

Any ideas?? What am I missing?

Thanks!!!
0
Comment
Question by:smithc
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
psdavis earned 200 total points
ID: 1167986
I'm going to assume that you've created these windows in a non-dialog.  Here's an answer I gave someone else just recently.  It is MFC based, but it might help you out.  

Tabs aren't automatically supported in a non-dialog setting.

It's probably going to be related to the same type of tab-control problem that you will encounter when adding controls to a view.  If you can get your hands on MFC Developer's Workshop by Frank Crockett, he's got an article about "Tabbing Between Child Window Controls in a Non-Dialog box view".

He basically handles the WM_CHAR and will post a WM_SWITCHFOCUS (user defined) message if the tab key is pressed.

He's got

afx_msg LRESULT OnSwitchFocus( WPARAM wParam, LPARAM lParam )
{
CWnd* pFocusWnd = (CWnd*) wparam;
CWnd* pNextWnd = pFocusWnd->GetNextWindow( );

if( ! pNextWnd )
   pNextWnd = GetWindow( GW_CHILD );

if( pNextWnd )
{
   pNextWnd->SetFocus( );
   return 0L;
}

AfxMessageBox( "error... " );

return (LRESULT) 0;

Hope this helps!
0
 

Author Comment

by:smithc
ID: 1167987
good idea. thanks
0
 

Author Comment

by:smithc
ID: 1167988
good idea thanks
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses
Course of the Month10 days, 22 hours left to enroll

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question