Question about dialogs and displaying/hiding controls

This is a discussion on Question about dialogs and displaying/hiding controls within the Windows Programming forums, part of the Platform Specific Boards category; Hi again, I just had a quick question. I'm running a dialog window as the main window for my program ...

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    52

    Question about dialogs and displaying/hiding controls

    Hi again,

    I just had a quick question. I'm running a dialog window as the main window for my program and i want the view to change depending on what I select from a combo box. Basically, I want the main layout to stay the same, I just want some controls to "disappear" and others to come up in their place, what would the best way to do this be?

    I don't want to make multilpe resources and use ShowWindow(item, SW_HIDE|SW_SHOW) because that would be stupid, should I used MDI or something or is that the completely wrong track?

    Thanks,
    - Daniel Wallace

  2. #2
    Registered User
    Join Date
    Aug 2003
    Posts
    288
    you could try making a button using the BS_GROUPBOX, and then create controls using the button as the parent, then just show/hide the groupboxes as you select different options in the combobox.

    actually, i beleive you can make any class, try a static control, and create controls using the static control as the parent.

    the groupbox just adds a frame around it

  3. #3
    Registered User
    Join Date
    Sep 2002
    Posts
    52
    Thanks for that.

    I went home and had a look around, I just created child dialogs for each set of controls I wanted and just set the main dialog (the one with the combo box) as the parent. Worked great.

    Plus when the parent got the WM_SIZE notification I used MoveWindow() to resize the child dialog
    - Daniel Wallace

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21