I need a smooth transition from One Dialog to another Dialog that looks the same
I am creating an app that h开发者_JAVA百科as a row of buttons across the top and depending on the button that gets selected another row of buttons appears across the side. The way I planned on doing this is to create a separate dialog box for each of the top row of buttons and have a new dialog pop up when a button is selected. So far I am able to pop up the new dialog and hide the main one but it's obvious that something has happened. Does anyone know how to make this appear seamlessly?
Thanks for your help! Mary
If the interface changes the user SHOULD see the change. It helps them use the program effectively. Is what you're trying to achieve a more aesthetic transition?
The most commonly used solution for what you are trying to achieve is to have a dialog nested inside the main dialog. Let me explain:
- Put the top buttons on the main dialog
- Create a new dialog and set it's Style to Child so that it will be moved and nested inside another dialog
- When you create the second dialog (when calling the function Create in the code) make sure you specify the first dialog as it's parent. Make sure you don't use DoModal to show this dialog. Use Create and then ShowWindow.
- Make sure the second dialog is smaller than the first and position it so that it appears under the button row.
In this way you can create a separate dialog for each button press, each dialog having different controls thus simulating a tabbed interface. See a partial example here: http://www.codeproject.com/kb/dialog/modelesschild.aspx
Hope this helps.
This sounds like a property sheet interface. Those use a row of tabs on top, not buttons. Using that visual interface is both easier for you: CPropertySheet
and your users, who are already familiar with that interface.
精彩评论