Thread: Toolbar/TabControl Problem

  1. #1
    Registered User plungermonkey's Avatar
    Join Date
    Dec 2002
    Posts
    6

    Toolbar/TabControl Problem

    I have my Toolbar and TabControl both up and running properly, except that the Toolbar covers the Tabs of the TabControl. How do you fix this? I have searched high and low and can't find the answer

    TIA

    -Jef

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Move the tab control down below the toolbar on the parent's client area. You can either do this by specifying the dimensions when you create the tab control or at runtime with either MoveWindow or SetWindowPos.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    Registered User plungermonkey's Avatar
    Join Date
    Dec 2002
    Posts
    6
    Quote Originally Posted by Ken Fitlike
    Move the tab control down below the toolbar on the parent's client area. You can either do this by specifying the dimensions when you create the tab control or at runtime with either MoveWindow or SetWindowPos.
    Thanks Ken.

    BTW, I'm working with your examples to learn all this stuff. I guess my
    main problem is getting the TabControl to resize automagically whenever I toggle the Toolbar on or off. You wouldn't happen to have a snippet of code to show how this is done would you? Sorry for not being more specific in the original post. Still trying to get my head wrapped around coding for Windows...

    -Jef

  4. #4
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Write a function to [edit]take[/edit] care of it; presumably you're toggling the toolbar visibility in response to specific user actions (menu,keyboard, etc.) - just call your diy 'resizing' function in response to that. Something like:
    Code:
    /*get wnd dimensions*/
    RECT rc,rcToolbar;
    GetClientRect(hParent,&rc);
    GetClientRect(hToolbar,&rcToolbar);
    if (toolbar_is_visible==TRUE)
      {
      rc.bottom-=rcToolbar.bottom;
      }
    MoveWindow(hTabCntrl,0,0,rc.right,rc.bottom,1);
    Where toolbar_is_visible is some BOOLean value defined by yourself which reflects the visibility of the toolbar.
    Last edited by Ken Fitlike; 08-07-2004 at 10:33 AM.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM