Solved

tab order

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
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 goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

746 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

10 Experts available now in Live!

Get 1:1 Help Now