Solved

Listbox Scrollbars

Posted on 2002-07-24
7
474 Views
Last Modified: 2008-02-01
I'm using VB6 and have the following question:
How do I get rid of the vertical scrollbar on a list box? There is no option in the properties to turn them on/off, it just kicks in automatically when required.
I have seen how GetScrollInfo() and SetScrollInfo() API calls can get/set characteristics of the scrollbar state, e.g. the position, min value, max value, etc.

I would like to get rid of the scrollbar altogether (just hiding it would be adequate) because I would like to control the scrolling my self but without having to create my own control. I know a way I can simulate it without actually using a listbox but I'd like to avail of some of the other features a listbox provides without having to program these again.

Does anyone know how to get rid of the scrollbars on a listbox?
Or of another listbox control that has the ability to hide scrollbars?

Regards,
C.
0
Comment
Question by:cgallagher
7 Comments
 
LVL 2

Expert Comment

by:damienm
ID: 7174543
If you set the enabled property to false then no one will be able to scroll
0
 
LVL 1

Author Comment

by:cgallagher
ID: 7174603
It's not that I don't want them to scroll, I want to hide the scrollbar completely. If you add more items than the list can display it will still display the scrollbar. I actually don't want the scrollbar appearing at all. I still want them to have access to the listbox and select items aswell so for that reason disabling the scrollbar won't work.
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 7174840
You could try placing the items into a multi-line textbox, with scrollbars disabled.  To add an item to the end, simply concatenate vbCrLf follow by the desired text.

If the user clicks on the textbox, you could write some code to highlight the line selected.
0
ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 
LVL 1

Author Comment

by:cgallagher
ID: 7174908
It's a work around, and was the original was I was going to do it if I couldn't find a solution...

BUT... It is simpler to just create an image of what the right hand side of the listbox looks like and simply place the image in a picture box (with border style set to none) over where the scrollbar is going to appear...
There is my answer... This means that when you highlight an item you potentially loose a part of the blue "Highlighter" but who cares about that.

Sorry lads but I'm going to delete this question now!
0
 
LVL 1

Author Comment

by:cgallagher
ID: 7174940
What do you do if you have no Delete option in the experts exchange question page?

I have seen this happen before, but forget what to do...
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 7174969
Apparently this is a new "feature"
To delete, you'll have to add a zero-point question in customer support asking for this to be deleted.  It normally goes through a review process, but this should be easy as long as damienm has no objections.  I have no objections.
0
 
LVL 6

Accepted Solution

by:
Mindphaser earned 0 total points
ID: 7175149
Points refunded and moved to PAQ

** Mindphaser - Community Support Moderator **
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBA saving file message display 5 66
How does CurrentUser work? 10 37
Added a column screws up code 5 57
Child Form in front 4 47
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question