//File:Window.xaml.vb Imports System Imports System.Windows Imports System.Windows.Controls Imports System.Windows.Input Imports System.Windows.Media Namespace WpfApplication1 Public Partial Class EventSetterDemo Inherits Window Public Sub New() InitializeComponent() End Sub Private Sub ButtonOnClick(sender As Object, args As RoutedEventArgs) Dim btn As Button = TryCast(args.Source, Button) Console.WriteLine(btn.Content) End Sub End Class End Namespace