c# 如何实现窗体移动?

来源:百度知道 编辑:UC知道 时间:2024/06/23 12:55:34
各位大侠,当没有边界时,怎么通过拖动窗体界面移动窗体,谢谢了!!!
楼下的,你那个网址什么都没有阿

renzhijie99 正解,测试正确
鉴定完毕!

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using System.Runtime.InteropServices;

namespace WindowsApplication1
{
public partial class Form6 : Form
{
[DllImport("user32.dll")]
public static extern bool ReleaseCapture();
[DllImport("user32.dll")]
public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
public const int WM_SYSCOMMAND = 0x0112;
public const int SC_MOVE = 0xF010;
public const int HTCAPTION = 0x0002;

public Form6()
{
InitializeComponent();
}

private void Form6_MouseDown(object sender, MouseEventArgs e)