CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 1999
    Location
    France
    Posts
    393

    Toolbar that can't be resized by user

    Hi,

    I have a toolbar created as follows.
    Code:
    	if (!m_wndDynamicRuntimeToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | CBRS_TOP
    		| CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC | WS_DLGFRAME, CRect(0, 0, 0, 0), IDR_DYNAMICRUNTIMETOOLBAR) ||
    		!m_wndDynamicRuntimeToolBar.LoadToolBar(IDR_DYNAMICRUNTIMETOOLBAR))
    	{
    		TRACE0("Failed to create toolbar\n");
    		return -1;      // fail to create
    	}
    	m_wndDynamicRuntimeToolBar.EnableDocking(0);
    It has no gripper and shows only the buttons.
    The problem is that when you move the mouse on the edges of the toolbar you have the possibility to resize the toolbar.

    Does someone know how to prevent the user to be able to resize the toolbar?

    Thanks a lot!

  2. #2
    Join Date
    Mar 2004
    Location
    Central Florida
    Posts
    293

    Re: Toolbar that can't be resized by user

    Your problem is most likly the CBRS_SIZE_DYNAMIC flag. It's purpose is to make the toolbar resizable. Removing it should fix the issue.

  3. #3
    Join Date
    Sep 1999
    Location
    France
    Posts
    393

    Re: Toolbar that can't be resized by user

    Hi,

    Firstly, Thanks for answering.

    But it does not change anything.
    I still have the possibility to click on the edges and resize the bar.

    Any other ideas, perhaps SubClassing but SubClass what and override what???

    Thanks a lot

  4. #4
    Join Date
    Sep 1999
    Location
    France
    Posts
    393

    Re: Toolbar that can't be resized by user

    Hi,

    removing this flag works thanks, it was somewhere else that there was a mistake.

    Thanks it works now

  5. #5
    Join Date
    Mar 2004
    Location
    Central Florida
    Posts
    293

    Re: Toolbar that can't be resized by user

    Your welcome.

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