Solved

Displaying Property Pages as individual Dialogs

Posted on 1998-06-11
6
179 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
  • 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 3

Accepted Solution

by:
shaig earned 200 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
difference between String.subString() and String.subSequence() 6 199
fix34  challenge 9 119
sumHeights2  challenge 7 105
Problem to App 4 82
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

777 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