Click to See Complete Forum and Search --> : Blocking the ListBox Scrollbar
Atlantisoft
February 23rd, 2000, 03:16 PM
I want to make my own scroll bar for a listbox, and disable the one they use when you get more items than can be displayed in the specified height. Is there a way i can replace the standard microsoft scrollbar with art of my own? Or can i just completely block it's scroll bar and code my own? Anyone got an idea how? Any help would be greatly appretiated. Thanx in advance - Atlantis
Chris Eastwood
February 23rd, 2000, 05:44 PM
I answered a post earlier this year that showed how to remove the scrollbar from a listbox (I though it was a bit of a strange request - now I can see why it was required :)
Take a look at :
http://codeguru.developer.com/bbs/wt/showpost.pl?Board=vb&Number=12654&page=&view=&sb=
- it should help you get started with your own scrollbar, although you'll need to read up on the API messages that a ListBox deals with.
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb
Atlantisoft
February 23rd, 2000, 06:30 PM
Cool, Thanx. One more thing though. I'm sure this sounds very stupid, but...you're code uses "option explicit"...what's it do? heh... :/
Chris Eastwood
February 24th, 2000, 02:40 AM
I really don't know why M$ decide to leave out 'Option Explicit' as a default when you create a VB project.
Option Explicit at the top of every module (be it a form / control / module etc) tells VB that all variables must be declared somewhere in that module. If you miss out Option Explicit, then VB assumes that any non-declared variable is a variant (which use up lot's of memory - well, 16 bits each - plus the overhead of processing a variant). It can also lead to other problems with global / module wide variables.
To turn on Option Explicit in Visual Basic, go to the Tools Menu->Editor Tab, and check the 'Requires Variable Declaration' box. It may seem a bit of a hassle, but in the long run, you'll save yourself a heap of work later on.
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.