Change scrollBars behaviour?

General TRichView support forum. Please post your questions here
Post Reply
Sega-Zero
Posts: 19
Joined: Thu Nov 22, 2007 9:11 pm

Change scrollBars behaviour?

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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)
Sega-Zero
Posts: 19
Joined: Thu Nov 22, 2007 9:11 pm

Post 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
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Yes, WM_NCPaint is overriden to draw WinXP-themed border.
Try to set UseXPThemes property to False.
Sega-Zero
Posts: 19
Joined: Thu Nov 22, 2007 9:11 pm

Post 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)
Post Reply