🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
1 messages
1 total messages Started by Gary Setter Sun, 30 Mar 2003 00:20
Tab Control, Child Dialogs, and Initial Focus
#17228
Author: Gary Setter
Date: Sun, 30 Mar 2003 00:20
23 lines
2045 bytes
Hi,

I had a problem with the initial focus of a dialog.

I'm making a dialog with the tabbed control and child dialogs. For each tab
of the tabbed control I defined a child dialog in the RC file with the
controls that must be displayed for that tab. When the container dialog is
created, I create the child dialogs and then change the parent of each of
the controls to the container dialog.

The initial focus was going to the first control of the child dialog.
Explicitly calling SetFocus on the Ok button was ineffective. The Kernel was
changing focus back to the first child control after setup.

I found that I could set the focus where I wanted it by changing the Z-Order
of the Ok button like this:
 SetWindowPos(GetDlgItem(hWnd,IDOK),HWND_TOP,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);

Anyone know if this is the "right" way of the handling the problem or if
there is a better way?

Also, I found that I had to reverse the creation order of the child dialog
controls from normal so that the tab order is as expected.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads