Solved

tab order

Posted on 1998-07-16
3
349 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 50 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

911 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now