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

Thread: Making toolbars come and go

  1. #1
    Join Date
    Aug 2000
    Posts
    18

    Making toolbars come and go

    I have 4 toolbars that I want to show selectively - 2 on the right side and 2 on the bottom, but never more than one at a time in each location. I tried to use the WINDOWPLACEMENT structure to hide and restore them, but sometimes (not consistently) the ones for the bottom appear on the right when they are restored.

    I also tried to create the toolbars by doing the CreateEx somewhere other than the CMainframe.OnCreate and then calling DestroyWindow to get rid of them, but that was unsuccessful.


  2. #2
    Join Date
    Nov 1999
    Location
    Dresden / Germoney
    Posts
    1,402

    Re: Making toolbars come and go

    H,

    CFrameWnd:: use ShowControlBar to show or hide the bar. If this doesn't fix all problems, call DockControlBar explicitely after showing a TB, so it doesn't end up in the wrong place

    Helped?
    Peter


  3. #3
    Join Date
    Aug 2000
    Posts
    18

    Re: Making toolbars come and go

    thanks. the showcontrolbar almost works. it shows or hides the bar, but when it comes back, the size is incorrect (enough room for only 3 of 8 controls). When I drag the edge of the frame window, the rest of the toolbar appears. toolbar.UpdateWindow() has no effect. changing the create to SIZE_FIXED instead of SIZE_DYNAMIC moves the bar from the side to the top for some reason.


  4. #4
    Join Date
    Aug 2000
    Posts
    18

    Re: Making toolbars come and go

    forget the last post. everything worked fine. I had screwed something on the controls.


Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)