//File:Window.xaml.vb Imports System.Windows Imports System.Windows.Input Namespace WpfApplication1 Public Partial Class Window1 Inherits Window Public Sub New() InitializeComponent() End Sub Private Sub Button_Click(sender As Object, e As RoutedEventArgs) MessageBox.Show("Button Clicked", "Button") End Sub Private Sub StackPanel_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) e.Handled = True End Sub End Class End Namespace