Glossary Item Box
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
ovs As LabDevTools.VOldSwitch Private Sub btnCreateVOldSwitch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCreateVOldSwitch.Clickovs =
New LabDevTools.VOldSwitchovs.Name = "MyVOldSwitch"
ovs.Height = 150
ovs.Width = 50
Controls.Add(ovs)
End SubPrivate Sub btnDisposeVOldSwitch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisposeVOldSwitchClick If Not IsNothing(ovs) Then ovs.Dispose() End Sub
[C#]
LabDevTools.VOldSwitch ovs;
private void btnCreateVOldSwitch_Click(object sender, System.EventArgs e)
{
ovs = new LabDevTools.VOldSwitch();
ovs.Name = "MyVOldSwitch";
ovs.Height = 150;
ovs.Width = 50;
Controls.Add(ovs);
} private void btnDisposeVOldSwitch_Click(object sender, System.EventArgs e){
if(ovs!=null){ovs.Dispose();} }
Copyright © 2007 LabDevTools. All Rights Reserved.