AddHandler DialogWindow.Moving, AddressOf DialogWindow_Moving
PrivateSub DialogWindow_Moving(ByVal sender As System.Object, ByVal e As MovingEventArgs)
'Don't allow the dialog window to move more than 200 pixels
If (e.Left > 200) Then
e.Cancel = True
System.Diagnostics.Debug.WriteLine("Moving Cancelled")
ReturnEndIf
System.Diagnostics.Debug.WriteLine("Dialog Window Moving Successfully")
End Sub