[Windows Controls] How to get rid of the annoying line of top of an toolbar control

Started by
4 comments, last by Roxypinky 14 years ago
Hello everyone, Does anyone know of a trick to get rid of the line that a toolbar control draw at its top. I would have thought that settings TBstyle_TRANSPARENT would do the trick but it did nothing that I could see. Thank you, -Roxy
Advertisement
I've never done this, but I'd look into handling NM_CUSTOMDRAW, which I think ToolBars support. If you google around there are some articles about doing this in the context of other controls that should be helpful.
Yes it is possible if you set the TBstyle_CUSTOMERASE style to override the WM_ERASEBKGND where that annoying line is most likely drawn (I've not tried that yet). I'm afraid there is no easy route :( I was hoping for a flag I could set somewhere that would take care of it for me. Alright, times to get my hand dirty in some custom drawing code :P

Thanks a lot!
-Roxy
Alright, I knew there had to be a flag somewhere! Messing with WinSpy and the toolbars in the Windows Explorer and the reason I didn't find it in the toolbar documentation is because it's a common control style. Silly me :P. So if anyone is looking for that, the style is CCS_NODIVIDER. http://msdn.microsoft.com/en-us/library/bb775498(VS.85).aspx
Quote:Original post by Roxypinky
[...] it's a common control style. Silly me :P. So if anyone is looking for that, the style is CCS_NODIVIDER. http://msdn.microsoft.com/en-us/library/bb775498(VS.85).aspx

Cool. I hadn't known that existed ... and it works?
Yep... and I guess it should work for all common controls however I can't really think of another control that has dividers like this.. maybe it has some kind of different effect on other controls.

This topic is closed to new replies.

Advertisement