Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » How to resize a control bar thought functions? Collapse All
Subject Author Date
xiao weixiong Aug 6, 2007 - 6:58 AM

I crearte a control bar in program, but I want to implement that when I click one button, the control bar will be changed the size, I try to use the MoveWindow function to implement this, but it failed. Thanks

xiao weixiong Aug 7, 2007 - 9:12 AM

Hello Technical Support,
Thanks for your answer. I also want to know about that, if I click one button(this button is not on the CExtControlBar) that the control bar will change the size, I just want to find the functions to change the controlbar’s size. Other word, if I want to change the size of the dialog, i will use the function MoveWindow, so if I want to change the controlbar’s size, which function will I be used? Thanks!

Technical Support Aug 8, 2007 - 9:56 AM

Please download this sample, which demonstrates how to resize floating control bars programmaticaly. You can use exactly the same approach for docking control bars. But you should note that all the resizable control bars docked into one row/column always take up the entire row/column. So, their specified desired widths/heights will be used as proportional widths/heights for stretching bars into the entire row/column. You can also use the CExtControlBar::DockControlBarLTRB() method for docking one resizable control bar relative to some other one by specifying the desired space.

mai mike Aug 7, 2007 - 7:26 AM

Dear:
I create a toolbar button on the control bar. What i want to do is, the control bar can be changed size when i click this toolbar button.
How can i implement this feature?

Thank you

Mike

Technical Support Aug 7, 2007 - 9:31 AM

The toolbar can only change its size if you add or remove buttons to/from it and then invoke pToolbar->GetParentFrame()->RecalcLayout().

Technical Support Aug 6, 2007 - 8:52 AM

We guess you created a CExtControlBar control bar window. These kind of bars are designed to be similar to Visual Studio .NET/2005 dockable panes. Although it is possible to customize the behavior of control bars in particular situations, they are designed to be fully resizable and occupy the entire row/column of available space inside the main frame window. The control bars also support collapsing/expanding in style of Visual C++ 6.0 dockable panes. To enable this feature you should use the following class instead of CExtControlBar:

class CMyResizableBar : public CExtControlBar
{
      void CExtControlBar::OnNcAreaButtonsReinitialize()
      {
            ASSERT_VALID( this );
            INT nCountOfNcButtons = NcButtons_GetCount();
            if( nCountOfNcButtons > 0 )
                  return;
            NcButtons_Add( new CExtBarNcAreaButtonClose(this) );
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
            NcButtons_Add( new CExtBarNcAreaButtonAutoHide(this) );
#endif
            NcButtons_Add( new CExtBarNcAreaButtonExpand(this) );
            NcButtons_Add( new CExtBarNcAreaButtonMenu(this) );
      }
};
This control bar has one additional caption button for collapsing/expanding the bar.