本文介绍了有人可以向我解释拖动无边界框架的简单程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
private const int HT_CAPTION = 0x2; // what does this means
private const int WM_NCLBUTTONDOWN = 0x00A1; // what does this means
[DllImport("user32", CharSet = CharSet.Auto)]
private static extern bool ReleaseCapture(); // what does this means
[DllImport("user32", CharSet = CharSet.Auto)] // what does this means
private static extern int SendMessage( // what does this means
IntPtr hwnd,
int wMsg,
int wParam,
int lParam);
protected override void OnMouseDown(MouseEventArgs e)// what does this means
{
base.OnMouseDown(e);
if (e.Button == MouseButtons.Left)
{
Rectangle rct = DisplayRectangle;
if (
rct.Contains(e.Location))
{
ReleaseCapture(); SendMessage(panel1.Parent.Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
}
}
} }
推荐答案
这篇关于有人可以向我解释拖动无边界框架的简单程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!