[RESOLVED] Common Control Question: Slider
I'm to a point where I would like to add a slider to my application, but the common control Slider ( ComCtl32.OCX or MSComCtl.OCX ) is underpowered for what I want to do--much to my surprise. :rolleyes:
My quest was to make a transparent slider using API calls like SetBKMode. However, no matter what I do with these calls, I can't seem to override the control's default functionality. Is there a way to do it without having to subclass this one control?
It appears my options for a slider that doesn't clash with my color scheme is:
- Create my own control
- Subclass the existing control
- Use a third party control
Any ideas, tips, or directions in which to point me?
Re: Common Control Question: Slider
It seems that I can get mostly what I need by combining the knowledge out of the following two articles:
Set the background color of my difficult controls to a unique color--subclass--and then hit 'em with an API call or two that set those controls of unique color to mostly transparent (They still have a wierd dotted border around some of them)? :ehh:
How does it sound?
Re: Common Control Question: Slider
If you are clever, you could probably design your own TOTALLY custom slider using a few pictureboxes or something similar :-)
All you have to do is work on some sort of draggable slider element...I've done shiz like that in a few of my programs...see http://www.vbforums.com/attachment.p...chmentid=51306 which was written for someone here and the code within allows you to drag the boxes around the screen...you would only have to set a lower/upper limit and make the drag unidirectional rather than bidirectional and it'd be like a slider :-)
Re: Common Control Question: Slider
Quote:
Originally Posted by smUX
If you are clever, you could probably design your own TOTALLY custom slider using a few pictureboxes or something similar :-)
I think that is sarcasm in your post, but you are right that I can design my own control. I've already designed my own button & checkbox control for my application, but it does take a lot of time away from my main goal which is developing my application. I've even written a 4/5th-complete VScroll control, but you kinda get to a point where you're willing to make sacrifices to get mostly what you want vs. everything you want 'cause you only have some much free time as a working adult. :(
I was hoping that others have come before me with this "old, dying" language with something I can use, and when the time comes, I could revisit the control(s) and develop what I want. Having said that, I'll be glad to look at your control. :)
Re: Common Control Question: Slider
Quote:
Originally Posted by smUX
If you are clever, you could probably design your own TOTALLY custom slider using a few pictureboxes or something similar :-)
It appears that the ol' Microsoft KB had a few pointers to assist in creating a scrollbar/slider. Granted, it was written back for VB 3.0, but the logic is still relevant. The only weird factor is that you need a timer to update the control instead of using normal Paint/Refresh commands. Without a timer, your control can get into infinite loop territory in painting and repainting the control. Is there not another way to ensure it is responsive, but doesn't take 99% of the CPU?
( I'm still a novice with user controls because of these kinds of factors. :blush: )
Re: Common Control Question: Slider