Solved

tab order

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

756 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