Results 1 to 3 of 3

Thread: [2005] Click Event on Buttons created at Runtime

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2006
    Posts
    30

    [2005] Click Event on Buttons created at Runtime

    I'm just wondering how to use the click event on a button that I create during runtime.

    Thanks
    -->Nuke

  2. #2
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,950

    Re: [2005] Click Event on Buttons created at Runtime

    VB Code:
    1. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2.         Dim Button1 As New Button
    3.         Me.Controls.Add(Button1)
    4.         AddHandler Button1.Click, AddressOf Button1Click
    5.     End Sub
    6.  
    7.     Private Sub Button1Click(ByVal sender As Object, ByVal e As System.EventArgs)
    8.         'Do stuff
    9.     End Sub

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Oct 2006
    Posts
    30

    Re: [2005] Click Event on Buttons created at Runtime

    sweet, thanks a lot

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width