Glossary Item Box

LabDevTools Spedisci un commento su questo argomento.

PushButton 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 pb As LabDevTools.PushButton

Private Sub btnCreatePushButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCreatePushButton.Click

       pb = New LabDevTools.PushButton

       pb.Name = "hsMyPushButton"

       pb.Height = 100

       pb.Width = 50

       Controls.Add(pb)

End Sub

 

Private Sub btnDisposePushButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisposePushButtonClick

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

End Sub

 

[C#]

 

LabDevTools.PushButton pb;

private void btnCreatePushButton_Click(object senderSystem.EventArgs e)

{

       pb = new LabDevTools.PushButton();

       pb.Name = "hsMyPushButton";

       pb.Height = 100;

       pb.Width = 50;

       Controls.Add(pb);

}

 

private void  btnDisposePushButton_Click(object senderSystem.EventArgs e)

{

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

}

 

 


Copyright © 2007 LabDevTools. All Rights Reserved.