Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

tab order

Posted on 1998-07-16
3
Medium Priority
?
355 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

688 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