Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. When to use Dialog for app and when to use normal Window ?

When to use Dialog for app and when to use normal Window ?

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Defenestration
    wrote on last edited by
    #1

    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 ?

    M J 2 Replies Last reply
    0
    • D Defenestration

      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 ?

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      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:

      1 Reply Last reply
      0
      • D Defenestration

        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 ?

        J Offline
        J Offline
        JudyL_MD
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups