Click to See Complete Forum and Search --> : increase padding of separator in toolbar


supernater
August 22nd, 2009, 05:13 PM
Hi there,

In my toolbar I made a button that is a separator by using the BTNS_SEP style. I'm using this button to break up two buttons. However, that amount of separation is not enough for my tastes. Is there a way to increase the padding around the separator so that it is larger/thicker? Thanks.

dc_2000
August 23rd, 2009, 03:15 AM
You have three options:

(1) Put two or more separators (which will probably look silly)

(2) Create another toolbar and position it so that it is "enough for your tastes", or

(3) Program a toolbar from scratch and make separators thicker.

ovidiucucu
August 23rd, 2009, 03:25 AM
The trick is:
MSDN
TBBUTTON
If the button is a separator, that is, if fsStyle is set to BTNS_SEP, iBitmap determines the width of the separator, in pixels.


Example:
int nIndex = 2;
TBBUTTON tbb = {0};
tbb.fsStyle = BTNS_SEP; // or TBSTYLE_SEP;
tbb.iBitmap = 20; // The width of the separator, in pixels

::SendMessage(hWndToolbar, TB_INSERTBUTTON, (WPARAM)nIndex, (LPARAM)&tbb);

dc_2000
August 23rd, 2009, 03:34 AM
Hey, it's a good one, ovidiucucu. Is it actually documented?

ovidiucucu
August 23rd, 2009, 03:45 AM
Hey, it's a good one, ovidiucucu. Is it actually documented?
Yes. In MSDN (http://msdn.microsoft.com/en-us/library/bb760476(VS.85).aspx).

// Sorry, I added the quote later.

supernater
August 23rd, 2009, 05:41 PM
The trick is:


Example:
int nIndex = 2;
TBBUTTON tbb = {0};
tbb.fsStyle = BTNS_SEP; // or TBSTYLE_SEP;
tbb.iBitmap = 20; // The width of the separator, in pixels

::SendMessage(hWndToolbar, TB_INSERTBUTTON, (WPARAM)nIndex, (LPARAM)&tbb);



It worked! Thanks!