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 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



Comments

  • You Will Love Jordan Sneakers and like the Expertise

    Posted by BotsictastHom on 05/01/2013 09:37pm

    Hi there! I know this is kinda off topic nevertheless I'd figured I'd ask. Would you be interested in exchanging links or maybe guest authoring a blog article or vice-versa? My site covers a lot of the same topics as yours and I feel we could greatly benefit from each other. If you might be interested feel free to send me an e-mail. I look forward to hearing from you! Great blog by the way! [url=http://news.onfitnessmagazine.info/story.php?title=cheap-lebron-shoes]cheap lebron 9[/url]|

    Reply
  • Tree View Implementation?

    Posted by Legacy on 08/22/1999 12:00am

    Originally posted by: Jean-Claude Demosthenidy

    Have you implemented your control for multiple treeviews like in Dev Studio? If you have, please share your thoughts (and code if you have some)
    Thanks!

    Reply
  • Drawing tabs and text with the system colors

    Posted by Legacy on 02/23/1999 12:00am

    Originally posted by: Dan Anderson

    The only problem that I found with the source that you have furnished, is that the tabs used fixed colors for
    the background and the text.
    
    Below is a simple remedy to the problem, which I have implemented in XTabCtrl.cpp:

    Replaced:
    static CPen _penG(PS_SOLID, 1, RGB(128,128,128));
    With:
    static CPen cpBackground(PS_SOLID, 1, (OLE_COLOR)GetSysColor(COLOR_BTNFACE));

    Replaced:
    static CPen _penGG(PS_SOLID, 1, RGB(192,192,192));
    With:
    static CPen cpShade(PS_SOLID, 1, (OLE_COLOR)GetSysColor(COLOR_BTNSHADOW));

    Replaced:
    static CPen _penW(PS_SOLID, 1, RGB(255,255,255));
    With:
    static CPen cpWindowColor(PS_SOLID, 1, (OLE_COLOR)GetSysColor(COLOR_WINDOW));

    Replaced:
    static CPen _penB(PS_SOLID, 1, RGB(0,0,0));
    With:
    static CPen cpLetterForeColor(PS_SOLID, 1, (OLE_COLOR)GetSysColor(COLOR_BTNTEXT));

    Reply
  • Use!?

    Posted by Legacy on 02/17/1999 12:00am

    Originally posted by: Eugen Paval

    You may want looking at
    www.codeguru.com/advancedui/cdxCDynamicControls.shtml
    www.codeguru.com/dialog/Geometry.shtml
    for complete implementations of the concept.

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

  • On-demand Event Event Date: October 23, 2014 Despite the current "virtualize everything" mentality, there are advantages to utilizing physical hardware for certain tasks. This is especially true for backups. In many cases, it is clearly in an organization's best interest to make use of physical, purpose-built backup appliances rather than relying on virtual backup software (VBA - Virtual Backup Appliances). Join us for this webcast to learn why physical appliances are preferable to virtual backup appliances, …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds