Results 1 to 6 of 6

Thread: [RESOLVED] Common Control Question: Slider

  1. #1

    Thread Starter
    Hyperactive Member Fedhax's Avatar
    Join Date
    Aug 2006
    Posts
    293

    Resolved [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.

    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?
    Last edited by Fedhax; Sep 26th, 2006 at 03:13 PM. Reason: Typo Correction

  2. #2

    Thread Starter
    Hyperactive Member Fedhax's Avatar
    Join Date
    Aug 2006
    Posts
    293

    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)?

    How does it sound?

  3. #3
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    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 :-)
    Well, everyone else has been doing it :-)
    Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
    Expect more to come in future
    If I have helped you, RATE ME! :-)

    I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!

    And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.

  4. #4

    Thread Starter
    Hyperactive Member Fedhax's Avatar
    Join Date
    Aug 2006
    Posts
    293

    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.

  5. #5

    Thread Starter
    Hyperactive Member Fedhax's Avatar
    Join Date
    Aug 2006
    Posts
    293

    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. )

  6. #6
    Fanatic Member schoolbusdriver's Avatar
    Join Date
    Jan 2006
    Location
    O'er yonder
    Posts
    1,020

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width