• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 608
  • Last Modified:

DS_CONTROL

Online Help says:

Dialog Properties: More Styles
Control  
Creates a dialog box that works well as a child window of another dialog box, much like a page in a property sheet. This style allows the user to tab among the control windows of a child dialog box, use its accelerator keys, and so on. Type: Bool. Default: False.

This is the complete information i've found about it. I have no idea how it works to display other dialogs as control in a modal dialog box.

a sample program would be fine.
0
Gus012498
Asked:
Gus012498
  • 6
  • 5
1 Solution
 
MikeP090797Commented:
I think this style is for when you display multiple dialogs using CreateDialog.
0
 
Gus012498Author Commented:
HWND CreateDialog(
    HINSTANCE hInstance,      // handle to application instance
    LPCTSTR lpTemplate,      // identifies dialog box template name  
    HWND hWndParent,      // handle to owner window
    DLGPROC lpDialogFunc       // pointer to dialog box procedure
   );
How can I control the position of the child dialog.
I'd like to use a CDialog class for the child dialog.
0
 
MikeP090797Commented:
Ok, you can use the CDialog class, call the Create member to create it, and set the position in the OnInitDialog memeber.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
Gus012498Author Commented:
Have you got a sample???
0
 
MikeP090797Commented:
Create a CDialog based dialog for each dialog.
CDlg dlg;
dlg.Create(IDD_DLOG1, hwndParent);

BOOL
CDlg::OnInitDialog()
{
MoveWindow(X1, Y1, X2, Y2);
}
0
 
Gus012498Author Commented:
Works fine. Exept i can't see any control.
My child dialog contains four static text elements and four ddlboxes.

Create returns TRUE.


0
 
MikeP090797Commented:
You weren't supposed to see any control. DS_CONTROL is when you create more then one dialog, it will allow you to use tab to switch between them, that's it. the appearence of the dialog doesn't change
0
 
Gus012498Author Commented:
How can i then display a dialog as a part of a modal dialog?
0
 
MikeP090797Commented:
The second parameter of the CreateDialog must be the handle of the dialog
0
 
Gus012498Author Commented:
Tank you!

Is it also possible to to do this with a CDialog instead of a DlgProc?
0
 
MikeP090797Commented:
Yes, the second variable of CDialog::Create should be a parent dialog handle
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now