Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom Scrollbar

Status
Not open for further replies.

TLowder

Programmer
Mar 20, 2002
224
Hello,
I'm looking for a custom scrollbar with better looking graphics or more customizable graphics than the standard scrollbar. I've found a few on the web but I want your opinions from experience on which is better. Or maybe its best to just change using API? I have ListViews and some third party grids in which I would like to have better scrollbar graphics and to make wider. The scrollbar width is important to me and I've found that I can only change the width on the stand alone scrollbar. I guess I could either change the existing scrolls using API calls or link my grids etc. to a seperate scrollbar control. Either way, I would like to hear your opinions to point me in the path of least resistance.

Thanks,


Tom
 
I find that scroll bars are a pain anyway.
I have used triangular arrow head icons in image boxes arranged at the side like the forward and fast formard buttons on a cd player to zip up and down records in a grid at different speeds 1,10 and full frame with each click.
You can even make them a reversed arrow head while the mouse button is down so it looks liked you pressed them in.
 
>I find that scroll bars are a pain anyway

In what sense, ted?
 
ted,

You may like this then;

Private Sub Image1_MouseDown(index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)

Dim a$
Dim n
Dim t!

Grid1.SetFocus
MouseIsDown = True
Select Case index
Case 0
Sendkeys "{HOME}", True
Case 1
a$ = "{PGUP}"
GoSub theLoop1
Case 2
a$ = "{UP}"
GoSub theLoop1
Case 3
a$ = "{DOWN}"
GoSub theLoop1
Case 4
a$ = "{PGDN}"
GoSub theLoop1
Case 5
Sendkeys "{END}", True
End Select
MouseIsDown = False
Exit Sub

theLoop1:
'start scrolling slow and speed up when mouse button is held down
n = False
Do While MouseIsDown
Sendkeys a$, True
DoEvents
If n < 30 Then
n = n + 1
t! = Timer
Do While MouseIsDown And Timer - t! < 0.5 / n: DoEvents: Loop
End If
Loop
Return

End Sub

Private Sub Image1_MouseUp(index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)

MouseIsDown = False

End Sub

If you hav'nt done it already.
 
Hugh, what is 'Grid1'?

[gray]Experience is something you don't get until just after you need it.[/gray]
 
Error7 - It's a Grid Control in this case(Grid32.ocx vintage VB5 but on the VS6 CD with the other Sheridan Controls) but could just as easily be an MsFlexGrid or similar. The Grid is set up to display a window of records in a dataset (rather than the complete dataset) so the Grid's built-in vertical scroll bar is not of much use.

Anyway the thread is becoming side tracked...

Tom - have you considered building your own User Control or must you have a ready made solution? - may be a good place to pick up ideas in either case.
 
<I find that scroll bars are a pain anyway.

I understand how you feel about that, as I was used to doing something like what you describe in the old DOS world. However, most people use them regularly, which is why they are part of the UI standard. Unless you're programming just for yourself, in which case you can do whatever you want, it makes sense to adhere to that UI standard. In so doing you leverage the experience that your user base has in interacting with other applications.
 
> at the side like the forward and fast formard buttons on a cd player
Ok, it isn't really that the scroll bars are a pain, it is that they are the wrong control for what you want to do. Why not use the Microsoft Multimedia control?
 
>the Microsoft Multimedia control?

Looked interesting and seemed a revelation at first however I use buttons (actually image controls) like |<, <<, <, >, >>, >| to represent Go First, prev page, prev record, next record, next page, Go Last in my example so the (apparently fixed) symbols used in the MMC would not do it for me.

 
The pain I am referring to is that it is my opinion that in navigating to a record in a large grid or list is relatively difficult with a normal scroll bar as compared to just scooting up and down in variable steps of say 1, 10 or greater at a time.
This is even harder with standard controls when using the new common fine screen resolutions of say 1920 x 1200 or greater.

(My idea is something like searching thru a DVD for the scene where you fell asleep in front of the TV last night - so they provide variable speed "browsing")

I don't think the multimedia control is suitable for this purpose because I would suggest you need a few different "speed buttons".

I agree this does not conform to any "standard" so I provide a standard scroll bar as part of the control anyway but don't try to make it any bigger.
The original questioner I suspect is trying to make a larger scroll bar so it is easier to click on which gives weight to my original hypothesis.
Some years ago I wrote a large student record program using my method and all the users preferred it to just a scroll bar or a matching combo box method because the names were Asian and you would have 100's of Chongs etc. They searched by looking at all the criteria and sorting by different columns where necessary (not like normal Excel where all the columns get out of whack when you do this)

ALSO

Perhaps the questioner could look at whether a scroll on a list was a suitable method of locating a record anyway and that the matching method using a combo box might be better?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top