R
Robson Carvalho Machado
Dear friends,
I've created a new label and a new Button on my form using the above code.
Dim myLabel As Label
myLabel = New Label
myLabel.ID = "label1"
myLabel.Text = "Dynamic button test"
myLabel.Attributes("style") = "position:absolute;top:150px;left:100px"
PlaceHolder1.Controls.Add(myLabel)
Dim myButton As Button
myButton = New Button
myButton.ID = "Button1"
myButton.Text = "OK"
myButton.Attributes("style") =
"position:absolute;top:150px;left:150px"
PlaceHolder1.Controls.Add(myButton)
How can I set the actions executed on button1_Click event?
I've tried the following but it does not work:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
label1.Text = "Button Click"
End Sub
I've created a new label and a new Button on my form using the above code.
Dim myLabel As Label
myLabel = New Label
myLabel.ID = "label1"
myLabel.Text = "Dynamic button test"
myLabel.Attributes("style") = "position:absolute;top:150px;left:100px"
PlaceHolder1.Controls.Add(myLabel)
Dim myButton As Button
myButton = New Button
myButton.ID = "Button1"
myButton.Text = "OK"
myButton.Attributes("style") =
"position:absolute;top:150px;left:150px"
PlaceHolder1.Controls.Add(myButton)
How can I set the actions executed on button1_Click event?
I've tried the following but it does not work:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
label1.Text = "Button Click"
End Sub