WPF simple window moving
-
Tuesday, May 01, 2012 1:44 PM
Hello,
I have form with windowstyle = none (so i don't have title bar, and window buttons as i wanted). But i want to add window moving in my app. At the bottom i have image which is background for everything and i'd like to make move window when user drag this image. How can i do this? Maybe there is easier way to add window moving without adding titlebar etc.?
All Replies
-
Tuesday, May 01, 2012 3:10 PM
Hi,
use the DragMove-Method in the (correct Button) MouseDown event for that image control:
http://msdn.microsoft.com/en-us/library/system.windows.window.dragmove.aspx
private void image1_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { this.DragMove(); }
Regards,
- Edited by Thorsten GuderaMicrosoft Community Contributor Tuesday, May 01, 2012 3:11 PM
- Marked As Answer by pioncze Tuesday, May 01, 2012 4:36 PM

