Using the GMSI.NET Toggle
Special Note: This tutorial is aimed at showing a software developer how easy it is to configure a Global Majic Software .NET component and how much flexibility these components provide. Keep in mind that these are software components, NOT complete applications.
-
Place a Toggle GMSI.NET Control on a form. Resize the Toggle to suit your needs. This Toggle Control is Size (160, 240).
-
Either click the Advanced Configuration link in the Toggle property browser, or simply right click the control and select Advanced Configuration. From here you will have control of ToggleStates and Images, which will be used for this control. Note that all changes are real timeimmediately visible on the control.

-
On the left side of the Advanced Configuration window, click the Images property and then click on Images on the right.
- Click on the More
button that appears to the right of (Collection). Now the ImageObject Collection Editor will appear.
- Click the Add button twice and two images will appear named Image and Image1.
- Within the ImageObject Collection Editor, click Image on the Members side of the window (on the left side) and click on Image on the Image Properties side of the window (on the right side).
- Click on the More
button. The Open window will now appear.
- Select the liteoff2.jpg file (this image was included in your GMS .Net installation and is located in C:/Program Files/Global Majic Software/Graphics). This will add the liteoff2 image to the Image Collection. Click on Name and change it to LightOff.
- Now click Image1 on the Members side of the window (on the left side) and click on Image on the Image Properties side of the window (on the right side).
- Click on the More
button. The Open window will now appear. Select the liteon2.jpg file (this image was included in your GMS .Net installation and is located in C:/Program Files/Global Majic Software/Graphics). This will add the liteon2 image to the Image Collection. Click on Name and change it to LightOn.
- Click Ok in the ImageObject Collection Editor.

-
Click on the OffState property and under Appearance change the BorderType to Raised, the BorderWidth to the desired size, and the Color to a Light Gray. For all color choices, you can choose from the System color set, the Web color set, and the Custom color set by clicking the tabs at the top of the drop-down color menu.
- Still under Appearance, click on the Image property and click the Drop Down
button. A dropdown menu will appear with the Images from the Image Collection.
- Click on LightOff (liteoff2.jpg). This will add LightOff to the OffState.
- Click on the Text property and delete the "Off" text.
-
Click on the OnState property and under Appearance change the BorderType to Raised, the BorderWidth to the desired size, and the Color to a Light Gray.
- Click on the Image property and click the Drop Down
button. A dropdown menu will appear with the Images from the Image Collection.
- Click on LightOn, (liteon2.jpg) This will add LightOn to the OnState.
- Click on the Text property and delete the On text.
- Click OK in the Instrument Configuration window.
- The LightSwitch is now complete and should look like this.
-
Go to the Build menu and choose Build Solution to build the project. Under the Debug menu, choose Start to run it. The LightSwitch will now change on and off when it is clicked.
| Toggle On |
Toggle Off |
|
 |
Recently Visited Products