Click here to Skip to main content
13,292,205 members (55,784 online)
Click here to Skip to main content
Add your own
alternative version


56 bookmarked
Posted 27 Feb 2000

Tabbed Dialog Box Class

, 27 Feb 2000
Rate this:
Please Sign up or sign in to vote.
A docking dialog that auto-expands when the mouse passes over it
  • Download demo project - 27 Kb
  • Download source files - 8 Kb
  • Sample Image - TabDialog1.jpg   Sample Image - TabDialog2.jpg


    This class implements a brand new kind of dialog box that can be used with dialog based aplications.

    This class contains a Tab instead of the Dialog Title Bar. What is so cool about this dialog is that the dialog actually docks to side of the desktop. Then when the dialog loses focus, the main body of the dialog disappears with only the tab remaining visible! This is great for admin type applications that you always want your user to have available, yet not in the way.

    Then when you want to reactivate the dialog, instead of searching either the Task Bar or the Task Manager for your dialog, you simply move your mouse over the dialog's tab and the complete dialog reappears!

    Implementing the Tab Dialog

    1. Create your dialog resource as normal and get Class Wizard to generate a dialog class and data members for you. The dialog should'nt have the "Title Bar" and "System Menu" styles enabled.
    2. Insert TabDialog.cpp file into your project.
    3. include "TabDialog.h" file in your Dialog header File.
    4. Change the base class of the dialog to CTabDialog. Make sure you change all occurrence of CDialog to CTabDialog.
    5. On your Dialog constructor, you can modify the TabDialog properties :

      • m_hTitleIcon : handle to an icon to use as the Tab Icon
      • m_sTitle : Title to display in the Tab
      • m_bCloseBox : TRUE if you want a close bbox to appear in the Tab
      • m_bAutoTabSize : TRUE if you want the Tab Dialog to automatically compute the Tab size, depending of the Icon, the title and the close box.
      • m_nBorderPos : indicate the desktop border you want your tab dialog to be attached on. follwing values are possibles:
      • m_nXpos or m_nYpos : indicate the position in pixels of the tab Dialog, on the border you chosed.
      • m_bTopMost : TRUE if you want the Tab Dialog to be topMost
      • m_bAutoHide : TRUE if you want the Tab Dialog to auto show/hide when the mouse move on and out of it
      • m_nTabHeight : height of the tab in pixels.
      • m_nTabWidth : width of the tab in pixels (used if m_bAutoTabSize = FALSE)
    6. At runtime you can call the following methods:

      void SetTopMost(BOOL bTopMost) : specify the new TopMost status of the Window
      void SetAutoHide(BOOL bAutoHide): 
      specify the new AutoHide status of the Window

    The Sample Project

    I have included a sample Dialog based project which illustrates how the CTabDialog class can be used. It is a very simple dialog-based application which displays some basic controls.


    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

    Christophe Mestrallet
    United States United States
    No Biography provided

    You may also be interested in...

    Comments and Discussions

    GeneralMy vote of 5 Pin
    Member 100661393-Jun-13 5:21
    memberMember 100661393-Jun-13 5:21 
    GeneralNice dialog class.. Pin
    cool_raja7-May-07 20:13
    membercool_raja7-May-07 20:13 
    GeneralGreat, but...... Pin
    Bill S6-May-02 10:16
    memberBill S6-May-02 10:16 
    GeneralDynamic Resize Pin
    sanpee4-Jul-01 23:31
    membersanpee4-Jul-01 23:31 

    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.171207.1 | Last Updated 28 Feb 2000
    Article Copyright 2000 by Christophe Mestrallet
    Everything else Copyright © CodeProject, 1999-2017
    Layout: fixed | fluid