|
|
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|
|
using System.Data;
|
|
|
using System.Drawing;
|
|
|
using System.Linq;
|
|
|
+using System.Runtime.InteropServices;
|
|
|
using System.Text;
|
|
|
using System.Windows.Forms;
|
|
|
using UAS_MES.DataOperate;
|
|
|
@@ -14,6 +15,23 @@ namespace UAS_MES.Make
|
|
|
{
|
|
|
public partial class Make_NewMatainInf : Form
|
|
|
{
|
|
|
+ //所有用到了headBar的部分都需要这段代码
|
|
|
+ [DllImport("user32.dll")]
|
|
|
+ public static extern bool ReleaseCapture();
|
|
|
+
|
|
|
+ [DllImport("user32.dll")]
|
|
|
+ public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
|
|
|
+
|
|
|
+ [DllImport("user32.dll", EntryPoint = "GetWindowLong", CharSet = CharSet.Auto)]
|
|
|
+ public static extern int GetWindowLong(HandleRef hWnd, int nIndex);
|
|
|
+
|
|
|
+ [DllImport("user32.dll", EntryPoint = "SetWindowLong", CharSet = CharSet.Auto)]
|
|
|
+ public static extern IntPtr SetWindowLong(HandleRef hWnd, int nIndex, int dwNewLong);
|
|
|
+
|
|
|
+ public const int WM_SYSCOMMAND = 0x0112;
|
|
|
+ public const int SC_MOVE = 0xF010;
|
|
|
+ public const int HTCAPTION = 0x0002;
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 序列号
|
|
|
/// </summary>
|
|
|
@@ -227,5 +245,11 @@ namespace UAS_MES.Make
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
AddDataToListView(nr_name_lsv, dt);
|
|
|
}
|
|
|
+
|
|
|
+ private void headBar1_MouseDown(object sender, MouseEventArgs e)
|
|
|
+ {
|
|
|
+ ReleaseCapture();
|
|
|
+ SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
|
|
|
+ }
|
|
|
}
|
|
|
}
|