WPF 鼠标拖动界面

http://www.myexception.cn/c-sharp/918954.html

------解决方案--------------------

windowless  
this.MouseLeftButtonDown += delegate { DragMove(); }; 
------解决方案--------------------
你说的效果不好是指什么,是不是图片太大了? 
------解决方案--------------------
Form 的属性 ,有设置 最大,最小的 显示 和 边框样式的 属性。

showMax
showMin
broderStyle  

有这3个样式的。设置就可以了啊 
------解决方案--------------------
C# code
public partial class MainWindow
{
    // 在类里增加下列定义 
    public const int WM_NCLBUTTONDOWN = 0xA1;
    public const int HT_CAPTION = 0x2;
    [DllImport("user32.dll")] public static extern int SendMessage(IntPtr hWnd, int msg, int wParam, int lParam);
    [DllImport("user32.dll")] public static extern bool ReleaseCapture();

    public MainWindow()
    {
        InitializeComponent();
            
        // 在Window的构造函数里增加下列语句:
        MouseLeftButtonDown += (o, args) =>
            {
                var hwnd = new WindowInteropHelper(this).Handle;
                ReleaseCapture();
                SendMessage(hwnd, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
            };
    }
}

------解决方案--------------------
设置了WindowStyle = System.Windows.WindowStyle.None;吗?

C# code
        private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
           this.DragMove();
        }

------解决方案--------------------
嗯嗯,第一种好
------解决方案--------------------
wpf拖放功能实现
http://www.cnblogs.com/loveis715/archive/2011/12/05/2277384.html

你可能感兴趣的:(WPF 鼠标拖动界面)