Glossary Item Box

LabDevTools Send comments on this topic.

ACounter 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 ac As LabDevTools.ACounter

Private Sub btnCreateACounter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCreateACounter.Click

       ac = New LabDevTools.ACounter

       ac.Name = "MyACounter"

       ac.Height = 100

       ac.Width = 50

       Controls.Add(ac)

End Sub

 

Private Sub btnDisposeACounter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisposeACounter.Click

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

End Sub

 

[C#]

 

LabDevTools.ACounter ac;

private void btnCreateACounter_Click(object senderSystem.EventArgs e)

{

       ac = new LabDevTools.ACounter();

       ac.Name = "MyACounter";

       ac.Height = 100;

       ac.Width = 50;

       Controls.Add(ac);

}

 

private void  btnDisposeACounter_Click(object senderSystem.EventArgs e)

{

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

}

 

 


Copyright © 2007 LabDevTools. All Rights Reserved.