Sign in to follow this  

Show and Hide windows

This topic is 3194 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I am using Win32 API C++. Ok, so my problem is that in my program, I will have three "views". Each view shows a different set of controls/windows. For example: if the user presses the button for the first view the following controls will be available/shown: Textbox, two comboboxes, and a push button if the user presses the other button to be in view two the following controls will be available/shown and all the controls from view one will disapear: Listbox, pushbutton, date time picker. I am trying to figure out the best way of doing this. I known that in .net C++ there is a Panel control and whatever you place in the control will disapear with the panel if you set the panel visible property to false/hidden. But there is no direct panel control that works this way in Win32 API, is there? I am currently using a push button, and if the user presses the button then certain controls are set to hidden and other controls would be set to visible using: ShowWindow(HWND controlname,SW_HIDE); ShowWindow(HWND controlname,SW_SHOW); But I don't know if this is the best way to do this since I will be hiding a lot of controls and then showing a bunch of others, not to mention there are three views, and this can get messy. So is there a better way to go about doing this? Thanks, progames25

Share this post


Link to post
Share on other sites
You can create a dialog in your resource editor for each "panel" and then call ShowWindow() on that dialog. Make sure the dialog has the WS_CHILD style and is a child of the parent window.

Share this post


Link to post
Share on other sites
Thanks,
I messed around and tried that a bit but deleted it out of my project for now (had a few problems), I would have to re arrange some things to get it to work the way I want. So i'll use this as a last resort but is there any other possible way to do this?
Otherwise I'll go ahead and try the dialog thing.

Share this post


Link to post
Share on other sites
Hello,
Ok so I got a dialog box up and working and set up inside of my main window as a child. I only have one problem, the dialog has a solid background (windows tan color) and I need that background to be 100% transparent becuase my main window's(the parent) background is an image that covers the entire client area of the window. And I need that to be shown. So how can I make it so you cant even tell the dialog is even there, but you can still see completely the child controls in the dialog?


Thanks,
Progames25

Share this post


Link to post
Share on other sites

This topic is 3194 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this