Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Displaying Property Pages as individual Dialogs

Posted on 1998-06-11
6
Medium Priority
?
185 Views
Last Modified: 2013-11-20
I'm creating an application in which I would like to display certain pages as both individual dialog boxes, and as
the tabs of a property sheet. The user would be able to choose if they wanted them all together or not.

So, I created the pages as descendants of the CPropertyPage class... which is itself a descendant of CDialog.
But when I try to display the pages individually by calling DoModal(), it just crashes and won't display anything.

Any tips would be greatly appreciated.
--Anthony (ajnicholson@lucent.com)
0
Comment
Question by:nicholso
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 

Author Comment

by:nicholso
ID: 1317860
Adjusted points to 200
0
 
LVL 1

Expert Comment

by:motigust
ID: 1317861
You did the right thing.
It should work, maybe somthing else is wrong.

Were does it crushes? Which function?
Can you give an example of that point in your code?


0
 

Author Comment

by:nicholso
ID: 1317862
i tried it with a different dialog box and it works now. I don't know what the problem was.
Thanks for your time!

Anthony
0
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 
LVL 3

Accepted Solution

by:
shaig earned 800 total points
ID: 1317863
Acording to the MFC documentation CPropertyPage inherits from CWnd rather then from CDialog.
What i do is create ( DoModal() ) a property sheet with a single page instead of playing with dialog boxes, infact i can't remember when was the last time i used a dialig box. your thinking is right, CPropertyPage gives you modularity.

does this solution suit you?
0
 

Author Comment

by:nicholso
ID: 1317864
shaig:
 Your solution does work, but it looks silly because you have a window with a titlebar, then it has only 1 tab with the same title on it... is there any way to get the property
sheet you have created with only one page to not have a tab at the top?

Also, can you center the OK,Cancel,Apply buttons?
thanks
anthony
0
 
LVL 3

Expert Comment

by:shaig
ID: 1317865
I'll start with the buttons:
You can do whatever you want with the buttons ( including hiding them ) if you do this:

//sample code from the sheet's OnInitDialog
CWnd *pWnd = GetDlgItem( IDOK );
pWnd->MoveWindow( centerCordinates );
or:
pWnd->ShowWindow( SW_HIDE );

do the same with cancel, apply and help.
regarding the tab:  i don't have a clean solution. you can move the tab control up so the sheet's title bar will hide the sub-title, this can be done this way:
CTabCtrl *pTab = GetTabCtrl();
pTab->MoveWindow( reduce the y, cy condinates )

hope i've helped.

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question