Skip to content

Latest commit

 

History

History
50 lines (39 loc) · 2.3 KB

README.md

File metadata and controls

50 lines (39 loc) · 2.3 KB

CustomSwitch

Custom switch for app Windows Forms .NET

alt text

Getting Started

After compile the control in release mode, in ..Bin/Release there will be a .dll file. In my case "Interruttore.dll".

alt text

Insert the Switch control into the ToolBox in Visual Studio

  1. Open Visual Studio's Toolbox,
  2. Right mouse button and click in "Choose items" (Scegli elementi in Italian Language) alt text

  3. In the tab ".NET Framework Component", click in Open (Sfoglia in Italian Language) alt text

  4. Go to Bin/Relese directory of SwitchControl and click in dll file alt text

  5. Click OK and the control is addedd in your ToolBox.

Add Switch Control in Forms
For add the control in Windows Forms, you can drag and drop the control from ToolBox in Windows Forms

Events Of Control
The control generates two events: Private Sub Interruttore1_SwitchOFF() Handles Interruttore1.SwitchOFF and Private Sub Interruttore1_SwitchON() Handles Interruttore1.SwitchON

Property Of Control
The control has some property:

  • State: This property get or set the status of the control. Is possibile change this value from code and Property Box of control in the Appearance category
  • NoTextState: This property display or hides the control status text.

Basic Example of functionality:
In the Off Event PictureBox1.Image = My.Resources.spenta


alt text

In the On Event PictureBox1.Image = My.Resources.accesa


alt text

More Information

This project was created for educational purposes only. It is available to everyone for download and is open to modifications.

The Author

My name is Marco Puccio, I am a software developer from Palermo. I love technology in all its forms. I also deal with IT teaching.