Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: Rince on November 22, 2004, 08:08 PM

Title: Scroll bar
Post by: Rince on November 22, 2004, 08:08 PM
is there a way to change ur Vb projects scroll bar colour?
Title: Re: Scroll bar
Post by: LivedKrad on November 22, 2004, 08:13 PM
I think you can use CallWindowProc to set VScrollBar/HScrollBar's color.
Title: Re: Scroll bar
Post by: UserLoser. on November 23, 2004, 01:49 PM
Quote from: LivedKrad on November 22, 2004, 08:13 PM
I think you can use CallWindowProc to set VScrollBar/HScrollBar's color.

CallWindowProc is just what you use to return unhandled window messages by your subclasser to the original window proc, so, I don't think that can help.  I'd assume catching WM_CREATE, WM_DRAWITEM, or WM_PAINT and handling things in there could change the scroll bar's style
Title: Re: Scroll bar
Post by: LivedKrad on November 23, 2004, 05:16 PM
Well, like I said, I 'think' that could've worked. I just quickly searched for a solution via Google and grabbed the first thing I saw. I don't do much work with API because well, I don't program that often. Sorry for the misinformation, I obviously have a mediocre thought process. :P

I'm not saying I know what CallWindowProc does, but it seems like (from your post) that you could catch an unhandled message sent by the scrollbar's object and then actually handle it. (Since you used the words "catch" when describing the messages you could use to change properties.)
Title: Re: Scroll bar
Post by: FrOzeN on November 26, 2004, 06:55 AM
You can change scroll bar colours using theses API's but it takes alittle mucking around with them.. google the for more info..

QuoteFlatSB_EnableScrollBar 
FlatSB_GetScrollInfo 
FlatSB_GetScrollPos 
FlatSB_GetScrollProp 
FlatSB_GetScrollRange 
FlatSB_SetScrollInfo 
FlatSB_SetScrollPos 
FlatSB_SetScrollProp 
FlatSB_SetScrollRange 
FlatSB_ShowScrollBar

[EDIT] Well there also for creating ScrollBars dynamically but some still work for modifying scrollbar colours or you can create a new scrollbar over the existing which makes the other one unnoticeable.