我做了使用的代码下面的链接 Make a borderless form movable?C#添加一个click事件无边界拖动形式
圆圈形状可动的形式验证码
public const int WM_NCLBUTTONDOWN = 0xA1;
public const int HT_CAPTION = 0x2;
[System.Runtime.InteropServices.DllImportAttribute("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
[System.Runtime.InteropServices.DllImportAttribute("user32.dll")]
public static extern bool ReleaseCapture();
private void Form1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
ReleaseCapture();
SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
}
}
现在我的形式移动正如我想要的,但我想添加一个单击事件到该窗体,但点击事件不会触发。任何人都可以告诉我错过了什么吗?
注意:我只是想在某人点击我的表单时调用一个函数。
请向我们显示您的代码。 –
当我们甚至不知道您有什么时,很难知道您错过了什么...... – maccettura
我更新了问题 –