WPF simple window moving
-
1 พฤษภาคม 2555 13:44
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.?
ตอบทั้งหมด
-
1 พฤษภาคม 2555 15:10
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,
- แก้ไขโดย Thorsten GuderaMicrosoft Community Contributor 1 พฤษภาคม 2555 15:11
- ทำเครื่องหมายเป็นคำตอบโดย pioncze 1 พฤษภาคม 2555 16:36