|
-
February 23rd, 2000, 04:16 PM
#1
Blocking the ListBox Scrollbar
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
-
February 23rd, 2000, 06:44 PM
#2
Re: Blocking the ListBox Scrollbar
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...age=&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
-
February 23rd, 2000, 07:30 PM
#3
Re: Blocking the ListBox Scrollbar
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... :/
-
February 24th, 2000, 03:40 AM
#4
Re: Blocking the ListBox Scrollbar
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|