Thread: Tabbed documents

  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    150

    Tabbed documents

    I was wondering if there is a Window class for making window tabs, like the tabs in the Display pane in the control panel. i want to add multiple tabs to my window, but not with MDI, just add them as controls in the window.
    HA! I WIN!

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    The Display pane is a dlg with a TAB control.

    If the controls required are complex I use a seperate small dlg to hold them, created in the resouce editor (rather than on the fly).

    I create the smaller dlgs when the parent dlg is called. Hiding the ones I do not need.

    On a TAB change I hide the current smaller dlg and show the required one.

    I handle move msgs from the parent dlg to ensure the smaller dlgs stay in the right spot.

    Property pages can also be used (MFC CPropertyPage and CPropertySheet classes)
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  3. #3
    Registered User
    Join Date
    Mar 2006
    Posts
    150
    Well, I don't use MFC at all as I only have the express edition of visual c++, and i don't like to use resource files to do the work; i enjoy being able to create on the fly. Is there a class for a window tab similar to the EDIT or BUTTON class? You also mention that the display area of the tab is a window with a tab control, correct? How do i add a tab control to a window?
    Last edited by xixpsychoxix; 03-28-2009 at 09:12 PM.
    HA! I WIN!

  4. #4
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Quote Originally Posted by xixpsychoxix View Post
    and i don't like to use resource files to do the work; i enjoy being able to create on the fly.
    No using the correct tool for the job will make it harder.

    Quote Originally Posted by xixpsychoxix View Post
    Is there a class for a window tab similar to the EDIT or BUTTON class?
    TAB

    WC_TABCONTROL

    Quote Originally Posted by xixpsychoxix View Post
    You also mention that the display area of the tab is a window with a tab control, correct? How do i add a tab control to a window?
    Creatte a TAB control like any other control.

    To add items use the TabCrl_InsertItem() macro or send a TCM_INSERTITEM msg.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  5. #5
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Writing code for tab controls without using MFC or some third party library will not be a fun exercise. It can be done for sure but I certainly would not want to do it.

  6. #6
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,058
    Quote Originally Posted by xixpsychoxix View Post
    I was wondering if there is a Window class for making window tabs, like the tabs in the Display pane in the control panel. i want to add multiple tabs to my window, but not with MDI, just add them as controls in the window.
    I've put together some very simple POC code using Tab Controls which dynamically creates as many tabs as needed "on the fly" using 6 functions and approximately 70 lines of code.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can C++ be used in conjunction with XML Documents?
    By Junior89 in forum C++ Programming
    Replies: 3
    Last Post: 11-25-2005, 04:10 PM
  2. Need help with tabbed windows
    By JoshR in forum Windows Programming
    Replies: 6
    Last Post: 07-31-2005, 04:20 AM
  3. Printing documents through word
    By Robert602 in forum Windows Programming
    Replies: 3
    Last Post: 04-21-2002, 01:23 PM
  4. Communicating between Documents
    By Tesita in forum Windows Programming
    Replies: 0
    Last Post: 12-03-2001, 09:02 PM