Click here to Skip to main content
15,880,405 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Please anyone hint me what to use for navigating pages on button click in MFC. For example, in an antivirus we click on scan button and few portion of the dialog is replaced with new page.
Posted

You could use the CTabCtrl class[^]. Alternatively you could have different child windows that you display in the mainframe on top of each other.
 
Share this answer
 
Comments
nish1213 20-Aug-14 4:18am    
Thanks for the reply. I do not want a tabbed dialog. Also, I want the top and bottom area of the dialog to be fixed. Only middle contents are changed. You can get an idea about what I want by observing an antivirus' page switch on button click.
Richard MacCutchan 20-Aug-14 4:47am    
nish1213 20-Aug-14 5:37am    
This is about a wizard. In my case, I do not want any next, cancel etc buttons to navigate, but by using an icon button.
Richard MacCutchan 20-Aug-14 6:54am    
Then you will have to write some extra code to do it. I have shown you some possibilities; if they don't exactly fit your requirements then modify them, or learn from them. That's what being a develioper is about, not just copy and paste from the internet.
chandanadhikari 20-Aug-14 5:15am    
my 5! thanks for the link.
hi,
What you want to do can be done by redrawing the middle portion of the mainframe dynamically (i.e. at runtime).
I am just elaborating what Richard says in second part of his answer.
Make a mainframe.This mainframe will be a container which will hold your child windows.
And make 4 child windows top, bottom, middle1 and middle2 .
The child windows middle1 and middle2 will be dynamically created at run time based on some condition (for example initially middle1 was being displayed but when user inputs 'Next' in the bottom window, middle1 is destroyed and middle2 is drawn in its place) while top and bottom window can remain fixed at their positions.
Now you you need to know how to create the child windows dynamically.you can google for it .
You can start by having a look at this code project article[^]
 
Share this answer
 
v2
Comments
nish1213 20-Aug-14 6:22am    
Thanks for the idea and the link. Can u please tell if the tabbed view can be removed from property sheets? I just want to call a page on button click and the tab-like view should be hidden from the user.
chandanadhikari 20-Aug-14 6:35am    
i am not sure if that can be done. 2 things are possible
1). if you used the wizard to create the sheet then it might have some option to hide the tab view (like un-checking some option). In this case you are disabling the tabs altogether.
2). but if you want to do this at runtime then you need to create the page at runtime and position it so that it covers the tab area.
sorry mate i don't have time right now to try this and tell you for sure so you need to experiment.
Please upvote my solution if you found it helpful.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900