CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2003
    Posts
    76

    How do you make a modifiable dialog box?

    Hi gang,

    I have an application where i would like to have a dialog box
    whose configuration changes depending on the user settings,
    kind of like the color palette in Photoshop.

    Take a look at the example below. When i click on the circular
    button, it switches the configuration of the dialog box from RGB
    to CMYK. I would like to do something similar: have a button that
    gives me a menu which i can then select which of the two modes
    i want for the dialog box.

    i don't think property sheets are the answer for me, because
    in my understanding those are more often used for the tabs
    (like in this case to switch between Color, Swatches and Styles.

    Any ideas on how to do something like this properly?

    thanx in advance!

    -kel
    Attached Images Attached Images  

  2. #2
    Join Date
    Aug 2000
    Location
    New York, NY, USA
    Posts
    5,656
    You could define all controls in your dialog template, then show / hide them as needed.
    Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
    Convenience and productivity tools for Microsoft Visual Studio:
    FeinWindows - replacement windows manager for Visual Studio, and more...

  3. #3
    Join Date
    Oct 2003
    Posts
    76
    how do you do this? how can you hide certain members of the
    dialog box? and can you lay them out so that they are actually
    on top of each other?

    Also, how does the button open a pop-up menu?

    -kel

  4. #4
    Join Date
    Mar 2004
    Location
    100m below sea level
    Posts
    189
    //hides the window, in your case, the controls
    yourcontrol.ShowWindow (SW_HIDE);

    //swithc ti SW_SHOW to show the hidden window
    yourcontrol.ShowWindow (SW_SHOW);
    Come Join This Poll Where are we from? (Ultimate)

    Knowing is not enough; we must apply. Willing is not enough; we must do. - Johann Wolfgang
    An idle brain is the devil's workshop. - unknown

  5. #5
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150
    Use TrackPopupMenu(ex) to show a popup menu.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured