Article ID: 161886 - Last Review: November 21, 2006 - Revision: 3.3 Property Sheet as the View Window of a CFrameWndThis article was previously published under Q161886 SUMMARY The Psview.exe sample illustrates a technique of having a
PropertySheet- like view inside a CFrameWnd-derived class.
The following files are available for download from the Microsoft Download Center: Psview.exe (http://download.microsoft.com/download/vc40pro/sample1/1/win98/en-us/psview.exe) For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base: 119591
(http://support.microsoft.com/kb/119591/EN-US/
)
How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most
current virus-detection software that was available on the date that the file
was posted. The file is stored on security-enhanced servers that help to
prevent any unauthorized changes to the file.
NOTE: Use the -d option when running Psview.exe to decompress the file and recreate the proper directory structure. MORE INFORMATION The PropertySheet-like view is a window that has the look
of PropertySheet. It contains a row of tabs; clicking each tab will load the
appropriate page (or dialog template). NOTE: This article does not make use of either the Property Sheet or the Property Pages like the SNAPVW sample. Because of this, the frame window that contains the PropertySheet-like view can be resized as it normally would. However, controls inside a page (or dialog template) need to be moved manually to fit the page as they appear in a regular dialog box. The picture below shows the general layout of the frame window when it is first running: CFrameWnd-derived class
+---------------------------------------------------+
| +-----------------------------------------------+ |
| | CToolBar class | |
| +-----------------------------------------------+ |
| +-----------------------------------------------+<----+
| | CTabCtrl class | | |
| |-----------------------------------------------| | |
| | | | |
| | | | |
| | CDialog-derived class | | |-- CView-derived
| | (a child of CTabCtrl class) | | | class
| | | | |
| | | | |
| | | | |
| +-----------------------------------------------+<----+
| +-----------------------------------------------+ |
| | CStatusBar class | |
| +-----------------------------------------------+ |
+---------------------------------------------------+
For simplicity, all pages in the sample code are created after the tab control is successfully created in the view window. (The code for page creation can be found in the CreatePages() function in tabview.cpp file.) These pages will not be destroyed until the application shuts down. When the view window receives the input focus (when the application is first running), the page for the first tab will be the visible page in the display area of the tab control. Whenever a tab is selected from the tab control, both TCN_SELCHANGING and TCN_SELCHANGE notification codes will be sent to the parent window (the CView-derived class). The first notification code is to notify the parent window that the currently selected tab is about to change. It is a good place to put code to hide the currently visible page. On the other hand, displaying the newly-selected page may be handled in the second notification code. The following list shows the general steps to have a PropertySheet-like view in an AppWizard-generated application:
REFERENCES Please refer to Visual C++ Books for information about the
classes mentioned in the article and ClassWizard usage for creating .h and .cpp
files for all pages. APPLIES TO
| Article Translations
|

Back to the top
