Solved

Displaying Property Pages as individual Dialogs

Posted on 1998-06-11
6
176 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
Comment Utility
Adjusted points to 200
0
 
LVL 1

Expert Comment

by:motigust
Comment Utility
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
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 3

Accepted Solution

by:
shaig earned 200 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now