Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > listbox larger scroll bar/buttons


Reply
 
Thread Tools Display Modes
  #1  
Old 03-11-2003, 07:47 AM
sticksbs sticksbs is offline
Regular
 
Join Date: May 2002
Posts: 89
Default listbox larger scroll bar/buttons


Hi guys,

I searched the forum but didn't come up with any info. My question is in regards to using a listbox, what i'd like to do is have a larger (more wider) scroll bar. Because i'm creating a small application that runs on a touch screen I was hoping for some way to allow for a larger listbox scroll button that is more easier to click on.

An alternative I guess would be if there was a way to create something else that can be clicked that would serve as the scroll buttons instead (like an image that mimics the scroll button being clicked or something.)

Any suggestions would be appreciated,

Thank you.
Reply With Quote
  #2  
Old 03-11-2003, 07:50 AM
Flyguy's Avatar
Flyguy Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 18,883
Default

You can always add buttons with up/down arrow images
Reply With Quote
  #3  
Old 03-11-2003, 08:03 AM
sticksbs sticksbs is offline
Regular
 
Join Date: May 2002
Posts: 89
Default

Quote:
Originally Posted by Flyguy
You can always add buttons with up/down arrow images
Thanks for the quick reply, I was thinking I could do this but didn't know how to, like in my image_click event what do i tell it to do if the listbox is called list1. I tried raiseEvents but didn't know what even to raise...
Reply With Quote
  #4  
Old 03-11-2003, 08:54 AM
Flyguy's Avatar
Flyguy Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 18,883
Default

Code:
Private Sub cmdUp_Click()
  Dim lIndex As Long
 
  lIndex = List1.ListIndex - 1
  If lIndex < 0 Then lIndex = 0
  List1.ListIndex = lIndex
End Sub

Private Sub cmdDown_Click()
  Dim lIndex As Long
 
  lIndex = List1.ListIndex + 1
  If lIndex > List1.ListCount - 1 Then lIndex = List1.ListCount - 1
  List1.ListIndex = lIndex
End Sub
Reply With Quote
  #5  
Old 03-11-2003, 08:56 AM
Uplink2069's Avatar
Uplink2069 Uplink2069 is offline
Junior Contributor
 
Join Date: Jan 2003
Location: UK
Posts: 403
Default

flyguy, i once played with a VB control with was two up/down command buttons built it, just for what your talking about, i just cant remember what it was (it came with VB i think)
__________________
=Uplink2069=
Reply With Quote
  #6  
Old 03-11-2003, 08:58 AM
Uplink2069's Avatar
Uplink2069 Uplink2069 is offline
Junior Contributor
 
Join Date: Jan 2003
Location: UK
Posts: 403
Default

woohoo, found it. its called the UpDown control: Microsoft Windows Common Controls-2 6.0(SP3)
__________________
=Uplink2069=
Reply With Quote
  #7  
Old 03-11-2003, 08:58 AM
Flyguy's Avatar
Flyguy Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 18,883
Default

It's called the UpDown control and is in Microsoft Windows Common Control-2

But my example is just for two normal command buttons.
Reply With Quote
  #8  
Old 03-11-2003, 09:00 AM
Uplink2069's Avatar
Uplink2069 Uplink2069 is offline
Junior Contributor
 
Join Date: Jan 2003
Location: UK
Posts: 403
Default

yea, i also think it may not be suitable for a touch screen input device (quite thin!) go with flyguy's idea!
__________________
=Uplink2069=
Reply With Quote
  #9  
Old 03-11-2003, 02:28 PM
sticksbs sticksbs is offline
Regular
 
Join Date: May 2002
Posts: 89
Default

Hi guys,

Flyguy's idea would work, however the only problem is that it would move up and down by selecting the items, I however still wanted the option of scrolling up and down without actually changing the selected item. (Thus I was hoping to find a way to simply enlarge the width of the scroll bar.)

However if that's not possible I guess flyguy's idea is the only one that I can use (although the problem i see with that is it not continusouly scrolling as long as the button is pressed... I guess i could always implement a timer for that...)

Thanks
Reply With Quote
  #10  
Old 03-11-2003, 04:04 PM
Flyguy's Avatar
Flyguy Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 18,883
Default

Try the .TopIndex property, this well set/return the topmost list item.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
horizontal scroll for listbox bluecraby2k Interface and Graphics 4 10-07-2004 02:14 PM
Listbox scroll cosmosis General 3 12-02-2002 08:15 AM
How to Auto Scroll Listbox to latest item nsh General 2 05-06-2002 09:20 PM
how to scroll a listbox? PrimeMov3r Miscellaneous Languages 1 04-20-2002 11:23 AM
ListBox w/o scroll bar? RussianSpy General 13 01-04-2002 11:46 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->