Glossary Item Box

LabDevTools Send comments on this topic.

HSwitch Constructor

In order to begin one new request of the control is necessary to use New constructor while, the used resources come released with the method Dispose.

 

Example:

 

[Visual Basic]

 

Dim hs As LabDevTools.HSwitch

Private Sub btnCreateHSwitch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCreateHSwitch.Click

       hs = New LabDevTools.HSwitch

       hs.Name = "hsMyHSwitch"

       hs.Height = 50

       hs.Width = 100

       Controls.Add(hs)

End Sub

 

Private Sub btnDisposeHSwitch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisposeHSwitchClick

         If Not IsNothing(hs) Then hs.Dispose()

End Sub

 

[C#]

 

LabDevTools.HSwitch hs;

private void btnCreateHSwitch_Click(object senderSystem.EventArgs e)

{

       hs = new LabDevTools.HSwitch();

       hs.Name = "hsMyHSwitch";

       hs.Height = 50;

       hs.Width = 100;

       Controls.Add(hs);

}

 

private void  btnDisposeHSwitch_Click(object senderSystem.EventArgs e)

{

          if(hs!=null){hs.Dispose();}

}

 

 


Copyright © 2007 LabDevTools. All Rights Reserved.