473,574 Members | 2,588 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Edit control tab / child windows / tabstop

48 New Member

I'm working with win32API c++. I added the WS_TABSTOP to the edit windows, as well as the WS_EX_CONTROLPA RENT and DS_CONTROL to the parent window. Yet any numerous times of punching the tab key does nothing.

Anyone have sample code that works? I've searched for acouple hours and couldnt find anything without MFC. I refuse to use Visual products, hence my problem with the tab key not working.

Any help would be super,
May 30 '07 #1
10 14191
9,065 Recognized Expert Moderator Expert
What product are you using then?

For that matter what type of container are you using? Dialogue box or a window?

Are you sure that you have set the focus onto one of the controls in the first place (using SetFocus).
May 30 '07 #2
48 New Member
I'm using gcc to compile without MFC.

I want to tab through edit windows (text boxes)

...| WS_TABSTOP | WM_SETFOCUS is in my styles for the edit window I want to be focused first.

All my edit windows are created in some fashion close to this:

Expand|Select|Wrap|Line Numbers
  1. CreateWindow(
  2.                                 "EDIT",
  3.                                 "CY",
  4.                                 WS_VISIBLE | WS_CHILD | ES_LEFT | WS_BORDER | WS_TABSTOP| WM_SETFOCUS,
  5.                                 110,
  6.                                 25,
  7.                                 350,
  8.                                 20, 
  9.                                 hWnd, 
  10.                                 (HMENU)IDE_TITLE,
  11.                                 hInstance,
  12.                                 NULL);
May 30 '07 #3
9,065 Recognized Expert Moderator Expert
OK, but are you placing these edit boxes on a Window or on a Dialogue box?

In response to which message to the parent window are you creating these edit boxes, or where with-in the structure of your code?

If you don't wish to use MS software but do wish to write windows programs you may wish to consider using the Dev-C++ which comes with resource editors allowing you to create dialogue boxes in the normal way, as a resource, rather than creating them on the fly at runtime.
May 30 '07 #4
48 New Member
O a Dialogue Box is made from a resource?

and a Window is made from code?

If that is true, then I just learned that lingo. Since I like code more than
pretty pictures dragging on items, I've only used code (windows) in this
project. My parent window was created like this:
Expand|Select|Wrap|Line Numbers
  1. hwndMain = CreateWindowEx(0, //Extended window style
  2.                 ClassName, // Window class name
  3.                 WindowTitle, // Window title
  5.                 desktopRect->top, desktopRect->left, // (x,y) pos of the window
  6.                 desktopRect->right, desktopRect->bottom, // Width and height of the window
  7.                 NULL, // HWND of the parent window (can be null also)
  8.                 NULL, // Handle to menu
  9.                 g_hInstance, // Handle to application instance
  10.                 (void*)this); // Pointer to window creation data
And my tab key works, though instead of it jumping to a new text box it indents inside the text box. I would like for it to jump.

May 31 '07 #5
48 New Member
so basically i'm asking how to tab across these child windows(text boxes), if it is possible.
Jun 1 '07 #6
9,065 Recognized Expert Moderator Expert
You still have not explicitly said if you are trying to create a window or a dialogue box.

However assuming from the DS_CONTROL in this

Expand|Select|Wrap|Line Numbers
  1. hwndMain = CreateWindowEx(0, //Extended window style
  2.                 ClassName, // Window class name
  3.                 WindowTitle, // Window title
  5.                 desktopRect->top, desktopRect->left, // (x,y) pos of the window
  6.                 desktopRect->right, desktopRect->bottom, // Width and height of the window
  7.                 NULL, // HWND of the parent window (can be null also)
  8.                 NULL, // Handle to menu
  9.                 g_hInstance, // Handle to application instance
  10.                 (void*)this); // Pointer to window creation data
that you are trying to create a dialog box then you should not be calling CreateWindowEx (or CreateWindow) because these create windows.

You need to look up and call

DialogBoxIndire ct - if you wish to create a modal dialogue box

CreateDialogInd irect - if you wish to create a modeless dialogue box

These 2 functions do not use a dialogue resource to create the dialogue box so you will be able to create your edit boxes in them once they are created.

If the dialogue box layout is fixed it is normal to create a dialog resource to define them, then you could use

DialogBox - if you wish to create a modal dialogue box

CreateDialog - if you wish to create a modeless dialogue box

to create them at runtime.
Jun 1 '07 #7
48 New Member
I made a window inside a window. I don't know how else to explain except for saying I want to be able to tab between child windows which are in this case edit windows.
Jun 5 '07 #8
3 New Member
I don't know if it helps, but I'm exploring the same issue except I'm using VC++ 5 (stop laughing at the back, I've had it for years and it was cheap.)

Anyway, I've got a class derived from CView which has a number of objects embedded in it representing "lines" of information. Each "line" is itself a class derived from plain old CWnd that contains static text, two CButton controls and two "custom" controls derived from CEdit.

I spite of defining all the controls with WS_TABSTOP & WS_EX_CONTROLPA RENT I can't tab between the controls unless I add handlers to look for the "tab" keystrokes in my CEdit derived controls, and I can't do anything with the standard CButtons (and don't really want to create by own simply to handle the tab key.)

So in my case it's definitely CWnd's within CWnd's and not a CDialog box anywhere.

Any help would be much appreciated since I can't find anything in the VC++ online manuals.

Jun 21 '07 #9
3 New Member
Aha: I think I've found the answer to my own problem: Take a look at...

.... http://www.microsoft.c om/mind/0499/faq/faq0499.asp


.... http://support.microso ft.com/?kbid=165074

... for a description of what's up with tabbing between CWnd child window controls. The first article is specific to "web browsers within other windows" but the descriptions contained of how Windows handles tab keystrokes should prove illumunating.

And just in case anyone's reading this years after it was posted and the links have gone dead, look up "IsDialogMessag e" and "PreTranslateMe ssage" functions in your favourite search engine and hopefully you should find some useful information.

If your problems are inside Dialog boxes, hopefully the original respondant to this post can help you out.

Good Luck

Jun 21 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Robert | last post by:
Somebody knowing a (handy simple) solution for that? - Robert
by: Kevin Myers | last post by:
Hello, Please forgive my reposting of this note with hopefully a more relevant subject line. On an Access 2000 form under Windows 2000 I would like to use a Kodak Image Edit Control to display the contents of a TIFF image file. According to the very limited documentation that I have been able to locate so far, all I should need to do is...
by: david | last post by:
Anybody could give me hint how use this control in asp.net web form. The problem is: I try to use COM component in my web form app by using MS training kit for windows form application. I would like to do the similar thing. The guide asks me to add Masked Edit Control to the Toolbox by adding Microsoft Masked Edit Control and I did it....
by: Kostis | last post by:
Hello there! I have created a windows application in VB.NET and I want to retrieve data from an access database. I create the OleDbConnection, an OleDbAdapter, a dataset and finally a Data Form using the Data Form Wizard. Everything works fine. The problem is that I want to use the masked edit control to manage the way some fields appear,...
by: Scott | last post by:
Consider the follow code snippet. Why doesn't it work? // Initialize a CFont object with the characteristics given // in a LOGFONT structure. LOGFONT lf; memset(&lf, 0, sizeof(LOGFONT)); // clear out structure
by: james | last post by:
How can I control the placement of scrollbars in mdi child windows? I need to place a control at the top of my child form and this control needs to always be visible. The rest of the page needs to scroll. However the default behavior has the control scroll with the rest of the page. Even a toolstrip demonstrates this same behavior. Any...
by: diego | last post by:
Hello everyone. I have an MDI form (parent) that has a number of controls on it. When I display MDI child windows, the child windows appear behind the controls that are on the parent window. How can make it so that the child window are on top of the controls on the parent window. Thanks in advance. Diego
by: Mick_fae_Glesga | last post by:
Hello everyone! OK, I'm writing a windows program that requires the user to enter Cyrillic characters into an Edit control. But, I can't seem to get the Cyrillic characters to appear in the Edit Control... I get underscores '_' I know the cyrillic keyboard works... I use it in word programs, and other apps...
by: Hamed | last post by:
Hello I have a question about CHILD forms in an MDI form. How can I have a neat positioning of child windows in an MDI form? When I open a new child window in my MDI form it is opened in a new cascading position but when I opens a lot of forms, it goes out of the borders of the MDI form and a scroll bar appears in the MDI form.
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.