Page 1 of 1

Change scrollBars behaviour?

Posted: Thu Nov 22, 2007 9:18 pm
by Sega-Zero
Good daytime.
I want to skin scrollbars of richview/richviewedit. I use CoolSB library, which has ability to change a behaviour of scrollbars, enables them to be drawn as i wanted to (and optionally add there some additional buttons). But i stuck on one thing: scrollbars are drawn only when the mouse cursor is over them, or while dragging the thumb. In other cases there is only a white stripe instead of it. Are there any ways to solve this problem? Which mesasges need to be overloaded? Methods? Props?
Thank you anyway, Sega-Zero.

Posted: Fri Nov 23, 2007 5:29 am
by Sergey Tkachenko
TRichView components use standard scrollbars, there is nothing special with them.
Alternatively, you can hide scrollbars (VScrollVisible = HScrollVisible = False) and use external scrollbar components, updating them in events (OnVScrolled, OnHScrolled)

Posted: Fri Nov 23, 2007 8:16 am
by Sega-Zero
Yes, I understand you are using standard scrollbars... But in compare with TMemo... ScrollBars in Memo never hides. Besides, I can't use additional components because skinning working from dll and all a can have is the access to the window procedure.
Do you have some special WM_NCPaint handling? Because CoolSB works on that scheme:
1. Sets API hooks to all Set/GetScroll***
2. Overrides window proc.
3. Inside WM_NCPAINT it temporarily changes style to no scrollbars, calls old WM_NCPAINT, then restores old scrollstyle and overpaint scroll area

But it seems like working only when mouse is over scrollbars :(
Please help me to understand that moment

Posted: Fri Nov 23, 2007 3:55 pm
by Sergey Tkachenko
Yes, WM_NCPaint is overriden to draw WinXP-themed border.
Try to set UseXPThemes property to False.

Posted: Fri Nov 23, 2007 5:05 pm
by Sega-Zero
thanks with UseXPThemes, it helps me with scrollbars, but... Now the borders are in old 9x style... But I'll try to change it. Thanks anyway, you are the best)