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 Tech Support » Change the 'x' button size and image Collapse All
Subject Author Date
Offer Har Jan 19, 2011 - 10:52 AM

Dear Support,


We need to change the size of the ’X’ on all the control-bars (need to increase it) and we would like to change the image to our own.


How can we do this?


Thanks,


Ron.

Technical Support Jan 24, 2011 - 9:02 AM

There is no size computation event. Buttons just position themselves in the CExtBarNcAreaButton::OnNcAreaReposition() virtual method.

Offer Har Jan 24, 2011 - 9:16 AM

So how can I make the button bigger? I want it to be 120x20 pixels for example.

Technical Support Jan 24, 2011 - 12:18 PM

You can make it bigger and/or, optionally, position it on the left side of caption instead of the right one. This is demonstrated in the FixedSizePanels sample application. See the CMyResizableInFixedModeBar::CNcBackForwardNavigationBtn::OnNcAreaReposition() method’s source code. This method uses a width that equal to the height:

m_rc.right = m_rc.left + m_rc.Height();
You can make your button wider.

Technical Support Jan 20, 2011 - 2:30 AM

The X-button inside the CExtControlBar window caption is a CExtBarNcAreaButtonClose object and it’s non-HWND-based UI element. You should create your own class similar to CExtBarNcAreaButtonClose. Then you should create and use your own CExtControlBar-derived class which implements the CExtControlBar::OnNcAreaButtonsReinitialize() virtual method for instantiating your improved X-button. You will also need the same tabbed bar container class. Here is how to create it:

http://www.prof-uis.com/prof-uis/tech-support/faq/control-bars.aspx#how-to-remove-the-close-button-x-from-the-control-bar

Offer Har Jan 20, 2011 - 6:54 AM

Thanks.


Still It’s not clear to me where do I change the size of it - I understand that if I override the OnNcAreaDraw I can draw it, but where do I set the size of it?


Thanks,


Ron.