When to use Dialog for app and when to use normal Window ?
-
I have an app which will have a lot of controls on it, and will probably make it a dialog based app for easy layout of these controls. Are there any limitations/problems of making it dialog-based instead of normal window-based ? What are the rules on when an app should be dialog-based and when it should be a normal window-based ? Can a dialog based app have a menu bar and toolbar ?
-
I have an app which will have a lot of controls on it, and will probably make it a dialog based app for easy layout of these controls. Are there any limitations/problems of making it dialog-based instead of normal window-based ? What are the rules on when an app should be dialog-based and when it should be a normal window-based ? Can a dialog based app have a menu bar and toolbar ?
Defenestration wrote:
What are the rules on when an app should be dialog-based and when it should be a normal window-based ?
I don't know about the rules, but it can be a lot easier to layout many controls on a dialog resource than it is to create them manually at runtime for a window.
Defenestration wrote:
Can a dialog based app have a menu bar and toolbar ?
Yes The menu you can add to the dialog resource. For toolbars, you can do it manually... for one example, see DLGCBR32 Sample: Demonstrates Adding a Status Bar and Toolbar to Dialog Boxes[^] If you use MFC, IMO the easiest method is to use a frame window for the main window and use a modeless dialog as the client window (or you could even use a CFormView). MFC handles window decorations like toolbars and status bars and does the layout of the client window - makes it real easy to code. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
I have an app which will have a lot of controls on it, and will probably make it a dialog based app for easy layout of these controls. Are there any limitations/problems of making it dialog-based instead of normal window-based ? What are the rules on when an app should be dialog-based and when it should be a normal window-based ? Can a dialog based app have a menu bar and toolbar ?
Defenestration wrote:
I have an app which will have a lot of controls on it, and will probably make it a dialog based app for easy layout of these controls
For that kind of app, I prefer to use a SDI application where the view is a CFormView. The CFormView has an associated dialog resoruce - lay out your controls on that as you would for a dialog. The rest of the framework handles the menus and toolbars and such for you so you get a nice merging of dialog capabilities and "normal" window-based capabilities. Judy