//File:Window.xaml.vb Imports System.Windows Imports System.Windows.Input Public Partial Class GadgetWindow Inherits Window Public Sub New() InitializeComponent() End Sub Private Sub Window_MouseLeftButtonDown(sender As Object, e As MouseButtonEventArgs) Me.DragMove() End Sub Private Sub Button_Click(sender As Object, e As RoutedEventArgs) Me.Close() End Sub End Class