Important alert: (current site time 7/16/2013 3:09:35 AM EDT)
 

winzip icon

ucSlider 1.2

Email
Submitted on: 9/4/2005 9:34:33 PM
By: Carles P.V. 
Level: Beginner
User Rating: By 44 Users
Compatibility: VB 6.0
Views: 31053
 
     Make your own slider. Complete graphical slider control: Vertical/Horizontal orientation, ShowValueTip option, [Long] range... Sample project and some images included. __________________________________________________ Re-coded: 2005.05.29. OCX to private usercontrol.

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 53 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

11/13/2001 6:25:00 PMSteve H.

Nicely Done! Now if be nice if Microsoft would follow this example and create a slide control that supports something other than Integer values. Hint... Hint... Microsoft!
(If this comment was disrespectful, please report it.)

 
11/13/2001 6:25:54 PMSteve H.

Nicely Done! Now it would be nice if Microsoft would follow this example and create a slide control that supports something other than Integer values. Hint... Hint... Microsoft!
(If this comment was disrespectful, please report it.)

 
11/13/2001 8:42:00 PMCarles P.V.

Thanks!...

...It would be nice.
(If this comment was disrespectful, please report it.)

 
11/13/2001 9:25:04 PMThushan Fernando

ahhhh another classical hit by the man who brought us the awesum button. Thanks for sharing it with us! 5 gL0Be$
(If this comment was disrespectful, please report it.)

 
11/14/2001 6:05:51 AMCarles P.V.

Resize fixed.

Last upd.: 11/14
(If this comment was disrespectful, please report it.)

 
11/15/2001 4:42:25 AMZhu JinYong

Real nice Slider.how to get updated one?
Thanks.
(If this comment was disrespectful, please report it.)

 
11/15/2001 2:12:05 PMCarles P.V.

Thanks.

The zip is updated.
(If this comment was disrespectful, please report it.)

 
11/15/2001 9:27:57 PMAl Moledina

did it again! Carles. Another 5
(If this comment was disrespectful, please report it.)

 
11/16/2001 1:34:53 AMHybrid

Excellent work!!

I think you should make a toolbar or listbox control next to complete your set!!
(If this comment was disrespectful, please report it.)

 
11/16/2001 3:27:24 AMCarles P.V.

A ListBox control will be the next...

Thanks Al, thanks Hybrid.
(If this comment was disrespectful, please report it.)

 
11/16/2001 7:57:32 AMmichael

Hello Carles,
>
Your Slider control is excellent,
I give you 5 globes for this work.
>
Suggestion:
Make a scale (with 'GDI' functions)
optional 'Visible or not'
'...
Indent your Code and use more 'With'
statement`s.
>
Any suggestion For your next project`s
small Toolbar, Listbox, Statusbar, a small PrintPreview(50-80Kb)
>
>
Thanks for share your work.
(If this comment was disrespectful, please report it.)

 
11/16/2001 8:02:20 AMCarles P.V.

Thanks to you, Michael.
(If this comment was disrespectful, please report it.)

 
11/27/2001 9:07:48 AMSuPA KrAka

I couldn't find the OCX in the Zip File. PLZ Help!!!
THANX!!
(If this comment was disrespectful, please report it.)

 
11/27/2001 12:54:08 PMCarles P.V.

This site does not accept compiled files (EXE's, DLL's, OCX's).
These are automatically deleted from submissions to prevent viruses.

Open "Start.vbg" and compile it...
(If this comment was disrespectful, please report it.)

 
11/28/2001 7:24:13 PMG.

Looking forward to the listbox, Carles :)
G.
(If this comment was disrespectful, please report it.)

 
11/29/2001 7:03:26 AMCarles P.V.

Next moth...
(If this comment was disrespectful, please report it.)

 
11/29/2001 7:05:47 AMCarles P.V.

Sorry, ... next month.
(If this comment was disrespectful, please report it.)

 
11/30/2001 12:06:21 AMShafeek mohammed

one thing is missing in this slider. In other slider controls, if you click on the rail anywhere, slider will move to that position(see vb slider or winamp). This will make this slider perfect.

Anyway 5*
(If this comment was disrespectful, please report it.)

 
11/30/2001 4:13:12 AMCarles P.V.

Yes, you are right.
I'm going to add it today. I'll post a comment to notice the update.

Thanks.
(If this comment was disrespectful, please report it.)

 
11/30/2001 7:37:03 AMCarles P.V.

Zip updated.

See changes in MouseDown and MouseUp events.
(If this comment was disrespectful, please report it.)

 
3/8/2002 6:31:21 AMMike

The paths are a bit screwy :) but looks nice
(If this comment was disrespectful, please report it.)

 
3/14/2002 11:15:04 AMElias Barbosa

What can I say? IMPRESSIVE!

A little tip, though. Before zipping your files to upload, open the project files with Notepad and delete the absolute reference to the files. The files reference should always be relative if you want your project to work right away on other computer. What I got when I opened your project was a series of error messages saying that the forms where not found.

Exemple:

Form=..\..\..\..\..\Archivos de programa\Microsoft Visual Studio\VB Carles\Controls\cpvSlider\Test1.frm

Should be:
Form:Test1.frm

You shouldn’t worry about the line:

Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\..\WI NDOWS\SYSTEM\stdole2.tlb#OLE
Automation

Visual Basic will correct the OLE reference automatically.

You should include a shot from the mixer on your screen shot.

You are getting five planets from me!


(If this comment was disrespectful, please report it.)

 
3/14/2002 11:37:43 AMCarles P.V.

Ooops, you are right.
I've forgot it.

I'm going to fix now.
(If this comment was disrespectful, please report it.)

 
3/19/2002 7:22:07 AMMike

Great slider, but i want to set up the graphics at runtime, not at design stage.

usually i would do blah.picture = LoadPicture(Variable)
but this does not work for railpicture of slidericon. could you add this?

Thanx
(If this comment was disrespectful, please report it.)

 
5/18/2002 12:43:40 PMVlad Vissoultchev

oops,

1) .Move x * 15, y * 15 in Function ShowTip is absolutely NOT working for large fonts (Screen.TwipsPerPixelX = 12:-)) so i get a pretty displaced tooltip. Use Screen.TwipsPerXXXX props.

2) in UserControl_MouseMove don't just count on SliderHooked for mousecapture. your usercontrol could have gotten WM_CANCELMODE and the capture will be released. instead put a simple check for vbLeftButton still being pressed in the beginning of the event like this: If (Button And vbLeftButton) = 0 Then SliderHooked = False. E.g. Press and hold left mouse put and drag the slider. Then WITHOUT releasing it press Ctrl+Esc. Release button. Try to move the mouse (with released button) over the control.

3) Mind that Button checks should be bitmask compares and not test for equality. Test your slider code this way. Press and hold left button and drag slider. Then WITHOUT releasing it press right :-)) "strange behaviour you get!" (Episode II?)

HTH,

Nice coding, btw.

</wqw>

(If this comment was disrespectful, please report it.)

 
5/24/2002 1:30:33 PMRyan

Would there be a way to make it so the background was transparent?
(If this comment was disrespectful, please report it.)

 
5/24/2002 1:39:49 PMRyan

Nevermind, I figured it out, This thing is awesome, 5 globes
(If this comment was disrespectful, please report it.)

 
5/28/2002 6:34:22 AMHoLaLou

Great work but can't get the OCX to install on a client, works fine at design time, runtime throws an error, saying not correctly registered, or files missing (this is on Win95 and 2K)
(If this comment was disrespectful, please report it.)

 
8/21/2002 4:34:48 PMDon

Nice job. I compile the Start project into an ocx control; however when I try to use the new ocx component, the standard rail and slider icon images do not show up and I get a Run-Time error '50003': Unexpected error. Is there a reference that was coded to look in a particular directory for these images?
Thanks in advance
(If this comment was disrespectful, please report it.)

 
9/27/2002 12:27:25 PM[\DReY\]

Hi Carles.

This is a great slider. adn im used into my mp3 player. please evaluate it Searching "DRey MP3 PlayeR" in PSC search box. Thanks.
(If this comment was disrespectful, please report it.)

 
2/7/2004 10:35:01 PM

how do you make the background transparent? i seem to get a little bit of bacground colour on each side of the sliderbar.
(If this comment was disrespectful, please report it.)

 
4/11/2004 4:08:38 AM

love the slider but like many outers i have seen you can not set the imag's from wintin the coding of the project form this would be a grate featuer to add for all slider controls
(If this comment was disrespectful, please report it.)

 
8/17/2004 12:37:41 PMAlaeddin Hallak

Here is an example of smart and clean programming. I've looking for such a thing coz the one Microsoft did makes the bottom the maximum when it's oriented vertically. You missed this pitfall (well duh!!!).. 5 stars all the way
(If this comment was disrespectful, please report it.)

 
9/2/2004 11:50:00 AM

Been searching two days for some way to fix the VB Slider or scrollbar to make it more colorful/get rid of the tool tip. Shoulda looked here first! Great job, this is ten times better than any of the other submissions found searching for "slider".
(If this comment was disrespectful, please report it.)

 
1/20/2005 10:05:59 AM

how can I make the exe file ?
(If this comment was disrespectful, please report it.)

 
2/7/2005 4:06:48 AM

5 stars! An excellent slider
(If this comment was disrespectful, please report it.)

 
9/14/2005 9:41:36 PMPaul Turcksin

Great code. Thanks for sharing and 5 from me.
(If this comment was disrespectful, please report it.)

 
1/8/2006 4:31:15 PMRogerWilco

How would you make the background of the slider transparent? Thanks!
(If this comment was disrespectful, please report it.)

 
2/7/2007 10:55:38 PMRob C

Perfection 5
(If this comment was disrespectful, please report it.)

 
9/13/2007 1:31:35 PMRobert Beer

Thanks for sharing it with us!
(If this comment was disrespectful, please report it.)

 
7/20/2009 6:32:41 PMquantum1976

I don't know if anyone is still checking this, but does anyone know how to make the background transparent? I tried changing the BackStyle to transparent, but this made the slider and rail disappear. I then set the slider and rail image boxes to Visible=True but then I couldn't click and drag the slider. I know I'm missing something simple.
Any help would be greatly appreciated.
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.