njsokalski
Well-known member
- Joined
- Mar 16, 2011
- Messages
- 102
- Programming Experience
- 5-10
I have Buttons in my app that are created and added dynamically, using code such as the following:
Dim mybutton as Button=New Button()
mybutton.Content="My Button"
AddHandler mybutton.Click, AddressOf Me.MyButtonClick
Me.LayoutRoot.Children.Add(mybutton)
And I have the following method defined to handle the event:
Private Sub MyButtonClick(sender As Object, e As System.EventArgs)
MessageBox.Show("Inside MyButtonClick")
End Sub
The Button is visible, but nothing happens when I tap it. I have other Buttons in my app that I add dynamically using the same technique that work fine, so what am I doing wrong? Thanks.
Dim mybutton as Button=New Button()
mybutton.Content="My Button"
AddHandler mybutton.Click, AddressOf Me.MyButtonClick
Me.LayoutRoot.Children.Add(mybutton)
And I have the following method defined to handle the event:
Private Sub MyButtonClick(sender As Object, e As System.EventArgs)
MessageBox.Show("Inside MyButtonClick")
End Sub
The Button is visible, but nothing happens when I tap it. I have other Buttons in my app that I add dynamically using the same technique that work fine, so what am I doing wrong? Thanks.