Hack Forums
[.NET] iOS-inspired switch button - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] iOS-inspired switch button (/showthread.php?tid=5532336)



iOS-inspired switch button - gigajew - Jan 23, 2017

Here's my iOS-inspired switch button. Requires the GraphicsExtension.cs written by Arun Reginald Zaheeruddin.

Implemented features:
switchButton1.Enabled = true | false;
switchButton1.Checked = true | false;

Experimental:
Transparent background: switchButton1.TransparentBackgroundFix = true | false;

[Image: rKWcT80.gif]
[Image: txoH26i.gif]

Download SwitchButton.cs here
Download GraphicsExtension.cs here


* - hfTP54 - Jan 24, 2017

Cool! Nice work OP just add an animation and shadow and it will look terrific.
PS. Enable double buffering then


* - gigajew - Jan 24, 2017

(Jan 24, 2017 12:11 AM)hfTP54 Wrote:  Cool! Nice work OP just add an animation and shadow and it will look terrific.
PS. Enable double buffering then

Double buffering is disabled because I was testing transparency (and transparency does not like double buffering)

As for animation I have no clue what I'm doing, and the round white switch thing has a little drop shadow


* - Narwin - Jan 24, 2017

Nice Op, I also drew two similar switches like this in two of my projects maybe I'll release one of them in time.
Keep it up buddy.


* - hfTP54 - Jan 24, 2017

(Jan 24, 2017 12:13 AM)gigajew Wrote:  Double buffering is disabled because I was testing transparency (and transparency does not like double buffering)
Look here: stackoverflow.com/questions/9358500/making-a-control-transparent

(Jan 24, 2017 12:13 AM)gigajew Wrote:  As for animation I have no clue what I'm doing, and the round white switch thing has a little drop shadow
Look here(by me🤝🎉):
hackforums.net/showthread.php?tid=5208432

Just set the beginning and ending x-coord of your circle as beginning and ending value,done.

Just a little more shadow please!


* - Ninja - Jan 24, 2017

(Jan 24, 2017 10:36 AM)hfTP54 Wrote:  Just set the beginning and ending x-coord of your circle as beginning and ending value,done.

Wow. share more of your wisdom, master.