CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Thread: TabControl

  1. #1
    Join Date
    Jul 2008
    Posts
    63

    Smile TabControl

    Hi
    i am developing an application in VS2005.
    this dialog based application has four button
    and four dialog box with same size . i want
    when i push button in mainDialog it work like
    a tab button and everytime show the dialog
    according to pushbutton.
    i,e i want the feature of tabcontrol but i do not
    use tabcontrol.
    thanks

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: TabControl

    Quote Originally Posted by anandji05 View Post
    ... i,e i want the feature of tabcontrol but i do not
    use tabcontrol.
    Why don't you use Tab control (or property sheet with property pages9 if you do need its features?
    Victor Nijegorodov

  3. #3
    Join Date
    Jul 2008
    Posts
    63

    Re: TabControl

    Thanks
    Actually i am using LIBUIDK for skins. this has all control but not tab control.
    i have requirement of Tab control.

  4. #4
    Join Date
    Jul 2002
    Posts
    2,543

    Re: TabControl

    For every child dialog, create resource with Border=None. Create every child dialog instance as modeless dialog with pointer to the main dialog: Create(dialog_id, pMainDlg).
    Initially show first child dialog using ShowWindow(SW_SHOW), and move it to required position using MoveWindow(&rect). rect is required child position in the main dialog coordinates.
    When another dialog should be activated, hide active child using ShowWindow(SW_HIDE), and activate new dialog using ShowWindow(SW_SHOW) and MoveWindow(&rect).
    For every child dialog, override OnCancel and OnOK with empty functions. This prevents closing child dialog when user presses OK and Esc.

  5. #5
    Join Date
    Jul 2008
    Posts
    63

    Re: TabControl

    Quote Originally Posted by Alex F View Post
    For every child dialog, create resource with Border=None. Create every child dialog instance as modeless dialog with pointer to the main dialog: Create(dialog_id, pMainDlg).
    Initially show first child dialog using ShowWindow(SW_SHOW), and move it to required position using MoveWindow(&rect). rect is required child position in the main dialog coordinates.
    When another dialog should be activated, hide active child using ShowWindow(SW_HIDE), and activate new dialog using ShowWindow(SW_SHOW) and MoveWindow(&rect).
    For every child dialog, override OnCancel and OnOK with empty functions. This prevents closing child dialog when user presses OK and Esc.
    thanks sir
    plz can you give me sample demo or some code.
    because i have no more idea about it.

  6. #6
    Join Date
    Jul 2002
    Posts
    2,543

    Re: TabControl

    One of my application works by this way, but it is too complicated to show it here. Just implement it exactly as I wrote. The idea is to create modeless dialog, which is shown in particular place of the parent dialog. This can be done using CDialog::Create, ShowWindow and MoveWindow functions. Once this is working, you can switch between different child dialogs, hiding active dialog and showing new one.

  7. #7
    Join Date
    Jul 2002
    Posts
    2,543

    Re: TabControl

    Take a look at attached sample (VS2005).
    Attached Files Attached Files

  8. #8
    Join Date
    Jul 2008
    Posts
    63

    Re: TabControl

    Quote Originally Posted by Alex F View Post
    Take a look at attached sample (VS2005).
    Thank you so much sir.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured