-
Nov 27th, 2021, 06:16 PM
#1
Thread Starter
Frenzied Member
-
Nov 27th, 2021, 06:23 PM
#2
Re: Looking for Custom UC checkbox on/off switch
I have seen some similar controls out there, but I'll let you search for them. One thing I often do is search with Google, with the site:vbforums.com as part of my search terms.
Also, if I were doing this from scratch, I might think about a custom UC just rotating through maybe half-a-dozen images of the switch sliding side-to-side to toggle it on or off. That would be a nice effect, and wouldn't need any GDI or GDI+ at all. GDI+ certainly does seem like overkill for something like this, regardless of how you do it.
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
-
Nov 27th, 2021, 07:16 PM
#3
Re: Looking for Custom UC checkbox on/off switch
I agree with Elroy. You can use simple images in combination with simple GDI calls like StretchBlt to achieve this. However, I won't lie to you, it's still going to take quite a bit of time. You still will need to handle drawing the text yourself which means you will have to deal with Fonts and stuff yourself which can get a bit involved when you're doing it using Win32 and GDI. You will also have to implement the check logic yourself which means handling of mouse events and whatnot. However, this is simple enough that you can do all that in a single night.
Too bad VB6 doesn't have something like WPF where you can do this in a couple of minutes.
EDIT:
On second thought, I just remembered that UserControls in VB6 handle Fonts by default so you can just use the DrawText Win32 function to draw your text into the UserControl's device context without concerning yourself with fonts. The UC internals would take care of all that. Not having to deal with fonts would save about an hour of work.
Last edited by Niya; Nov 27th, 2021 at 07:37 PM.
-
Nov 28th, 2021, 01:00 PM
#4
Member
Re: Looking for Custom UC checkbox on/off switch
You can get "LabelPlus" User Control (https://www.vbforums.com/showthread....3707-LabelPlus) from Leandro Ascierto
Here you have a proyect using LabelPlus and use that style http://leandroascierto.com/blog/descargador-de-videos/
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
|