Jump to content
Xtreme .Net Talk

Recommended Posts

  • *Experts*
Posted
Certainly.
'-- In the form
   Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
       Dim btn As New Button()

       With btn
           .Size = New Size(90, 40)
           .Location = New Point(15, 15)
           .Text = "Testing 1 2 3"

           'causes the newbtnClick procedure to fire on the click event.
           AddHandler btn.Click, AddressOf newbtnClick
       End With

       Me.Controls.Add(btn)
   End Sub

   Private Sub newbtnClick(ByVal sender As Object, ByVal e As EventArgs)
       MessageBox.Show("You clicked the button!")
   End Sub

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...