A resizable TabControl | CodeGuru

A resizable TabControl

A few notes about CXPropertyPage (A class derived from CDialog). This window class is contained by one CXPropertySheet. The text of item from CXPropertySheet will have the text for the resource string with the same identifier as the dialog. The CXPropertyPage has one m_bAutoSize member with the following property: if this is set, the first […]

Written By
CodeGuru Staff
CodeGuru Staff
Feb 13, 1999
2 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

A few notes about CXPropertyPage (A class derived from CDialog).

This window class is contained by one CXPropertySheet. The text of item from
CXPropertySheet will have the text for the resource string with the same identifier as the dialog.
The CXPropertyPage has one m_bAutoSize member with the following property: if this is
set, the first child of the property page is resized when the property page is resized. It is
useful when you have in the property sheet one window control. The value of this member can
be changed by operator =.

How to use these

The first is to add all sources files (X*.h, X*.cpp) into your project, and copy from the
demo project the IDR_XTABCTRL accelerator.

Using CXPropertySheet.

Create a few dialogs in the resource designer with the popup style
removed. Add from class wizard a new class for each new dialog. Into the source files
of these dialogs, change the “CDialog” string to “CXPropertyPage” (both header and source).
Now you have for each dialog one class CXPropertyPage. Declare as member one
CXPropertySheet. Call at initializing time the

  Create(TCXS_UP | TCXS_DOWN] | WS_CHILD | WS_VISIBLE, CRect(0,0,100,100), pParentWnd, nID);
  

function. The next step is adding pages into this class. So, call

  AddPage(new CXPropertyPage1, hIcon, lParam),
    

where:
   CXPropertyPage1 is the name of one of the dialogs generated by the class wizard,
   hIcon is the icon which you want to be displayed on item,
   lParam is user data.

The last two parameter are optionals. The easiest way to show how all these work, please see OnInitDialog from demo project.

Download demo project – 68 KB

Download source – 12 KB

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.