Click here to Skip to main content
13,352,631 members (33,786 online)
Click here to Skip to main content
Add your own
alternative version


45 bookmarked
Posted 4 Nov 2000

EZOptionsDlg - Netscape Preferences like dialog

, 16 Apr 2001
Rate this:
Please Sign up or sign in to vote.
A modified property sheet with the tree control replacing the tabs.

[Sample page 1 - 30K]

[Sample page 2 - 30K]


The point behind this article is to build a base for building a Netscape Prefs like dialog without compromising on the benefits provided by CPropertySheet and CPropertyPage.

To implement this dialog:

Step 1

Add the files present in the source zip file above, to your project.

Add the following lines in some globally available file like stdafx.h:

#include "EZPropertyPage.h"
#include "EZOptionsDlg.h"

Step 2

Add a dialog to your application and add a class for it, say CPrefDlg. Replace every occurrence of CDialog with CEZOptionsDlg in the header file and the source file of the dialog. This dialog takes the place of a property sheet.

Step 3

Edit the dialog template and add a tree control somewhere on the dialog.

Add the following lines to the OnInitDialog handler to introduce your tree control to the parent class CEZOptionsDlg:

// Assuming IDC_OPT_TREE and IDC_LABEL are the ID's
// of the tree control and the static control respectively

Step 4

Add a property page, CPage1 say, to your application and replace every instance of CPropertyPage with CEZPropertyPage in the header and source files.

Now, as you would do in a regular property sheet, declare a member variable for CPage1 in the dialog class (CPrefDlg) created in step 2. Add the following code similar to that of the normal CPropertySheet::AddPage. But CPage1::Create should be called before calling AddPage.

// If IDD_PROPPAGE_PAGE1 id the dialog resource ID

If you want to add a page as a child item, add the title of the parent item as the third parameter. To avoid unexpected behavior, the titles should be unique.

Here is the OnInitDialog function:

// in PrefDlg.h
#include "EZOptionsDlg.h"

class CPage1;

class CPrefDlg:public CEZOptionsDlg
    CPage1 m_page1;

// in PrefDlg.cpp
BOOL CPrefDlg::OnInitDialog()
// Assuming IDC_OPT_TREE is the ID's of the Tree control
// and the static control respectively


Again, to remove a page, the title is to be used. This is the reason why I say the titles should be unique.


Repeat the above step to add more pages.

The demo project should do the rest of the explanation.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Lakshmi Vyas
Web Developer
United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionHow to ad minimize icon on dialog style?? Pin
Evan Lin1-Jun-05 9:12
memberEvan Lin1-Jun-05 9:12 
I think the CPropertySheet is very useful
but how to modify the dialog style
such as MAXIMIZE or MINIMIZE button for this dialog?
Confused | :confused:
GeneralGood stuff Pin
antred1123-Mar-05 2:33
memberantred1123-Mar-05 2:33 
GeneralTabbing Pin
Dan Poch11-Jan-05 8:34
memberDan Poch11-Jan-05 8:34 
GeneralDir List Box Pin
Zloccowick15-Feb-02 0:42
memberZloccowick15-Feb-02 0:42 
GeneralTab order is not working. Pin
Anonymous6-Feb-02 23:15
memberAnonymous6-Feb-02 23:15 
GeneralGreat job. (Some modifications for dialog based app.) Pin
bwei28-Feb-01 0:41
memberbwei28-Feb-01 0:41 
GeneralBetter one exists... Pin
Anonymous16-Jan-01 12:55
memberAnonymous16-Jan-01 12:55 
GeneralBetter one exists... where exactly ? Pin
Guy LECOMTE17-Apr-01 23:19
memberGuy LECOMTE17-Apr-01 23:19 
GeneralRe: Better one exists... where exactly ? Pin
Henk Devos21-May-01 3:29
memberHenk Devos21-May-01 3:29 
GeneralRe: Better one exists... Pin
Anonymous12-Apr-02 6:44
memberAnonymous12-Apr-02 6:44 
GeneralEdit controls, tab order and more Pin
Anonymous10-Nov-00 2:27
memberAnonymous10-Nov-00 2:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.180111.1 | Last Updated 17 Apr 2001
Article Copyright 2000 by Lakshmi Vyas
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid