|
-
Apr 14th, 2005, 09:57 AM
#1
Thread Starter
Lively Member
button click event
I'm building a table in the code behind page, adding rows and colums to it, and i added a button into one of the cells.
Dim button9 As New Button
cellButtonb.Controls.Add(button9)
How can i add an event to this button. i tried
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
End Sub
but it didnt work
Thanks
Kati
-
Apr 14th, 2005, 03:27 PM
#2
Re: button click event
Use the AddHandler keyword, i.e.
VB Code:
Private Sub SomeRoutineAddingTheButton()
Dim button9 As New Button
AddHandler button9.Click, AddressOf Button9_Click
cellButtonb.Controls.Add(button9)
End Sub
Private Sub Button9_Click(ByVal sender As Object, ByVal e As EventArgs)
' Do Something Here
End Sub
Regards,
- Aaron.
-
Apr 15th, 2005, 03:24 AM
#3
Thread Starter
Lively Member
Re: button click event
Thanks a lot Aaron!!!
Kati
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|