1 Attachment(s)
Disabling a toolbar button with longish text
Hello... I originally posted this in the Visual C++ forum by mistake, so I'm reposting here in a more appropriate forum. I apologize if you have read this before but I hope I get to the right people this time.
I have recently added a new toolbar to my app -- a list/flat/transparent toolbar control. It is working fine in general, but I have encountered a problem when disabling a button that has longish text to the right of the icon.
It seems that even though the toolbar is accurately remembering the width of my button, it is clipping the text when disabled *only*. Attached is a screenshot that demonstrates the problem.
Though in the screenshot it seems that it gets cut off per letter, my original toolbar had letters cut off halfway.
I have tried setting the draw text flag DT_CLIP and DT_CALCRECT, both seperately and together, but neither have resolved my issue.
Has anybody experienced this before? Does anybody know a solution without customdrawing the toolbar?
Thanks in advance,
- Richard
Re: Disabling a toolbar button with longish text
Never seen that before but are you allowing the toolbar to size the buttons itself (TB_AUTOSIZE, I think)? If so, what happens if you manually specify the width of the button?
Re: Disabling a toolbar button with longish text
Hey Bond, thanks for the quick reply!
The buttons do have the BTNS_AUTOSIZE style set.
Manually specifying the width of the button isn't something that would be easily done in my code right now, but I will give it a shot tomorrow. Today's getting late and I have some errands to run.
Thanks again, I'll be back with what happened.
- Richard
Re: Disabling a toolbar button with longish text
I tried setting my first button's size with TB_SETBUTTONINFO, with LPIF_SIZE as dwMask, setting cx to 200. While it does make my button much larger, the disabled text is still clipped at the same position it was before.
I'm really thinking this is a problem with the Windows toolbar...
Re: Disabling a toolbar button with longish text
Well, for now I'll be omitting the text -- but if anybody knows a solution to this that lets me keep the text, please let me know!!