This is a migrated thread and some comments may be shown as answers.

Click event on dynamically created button

1 Answer 305 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 06 Dec 2017, 07:48 PM

Hi All

I have created buttons dynamically in vb.net using

 

Dim rb As New RadButton

 

How can I assign a click event to this button please?

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 07 Dec 2017, 11:35 AM
Hello Paul,

You can check the following MSDN article to see how to assign an even in code using VB.NET code. You can switch between the languages for the code snippets in the article from the drop down "Language" menu on the right side of the page. In general you can do the following:
Dim rb as New RadButton
AddHandler rb.Click, AddressOf Onb2Click
 
Private Sub Onb2Click(ByVal sender As Object, ByVal e As RoutedEventArgs)      
End Sub

I hope that helps.

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Buttons
Asked by
Paul
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or