1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- using System;
- using System.Drawing;
- using System.Runtime.InteropServices;
- using System.Windows.Forms;
- using System.Xml;
- namespace OTSMeasureApp._10_OTSSplashScreen
- {
- public partial class OTSSplashScreen_IncA : Form
- {
- #region 使窗体可以移动的代码
- [DllImport("user32.dll")]
- public static extern bool ReleaseCapture();
- [DllImport("user32.dll")]
- public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int IParam);
- public const int WM_SYSCOMMAND = 0x0112;
- public const int SC_MOVE = 0xF010;
- public const int HTCAPTION = 0x0002;
-
- #endregion
- public OTSSplashScreen_IncA()
- {
- InitializeComponent();
- }
- private void OTSSplashScreen_Load(object sender, EventArgs e)
- {
- }
- private void label2_Click(object sender, EventArgs e)
- {
- }
- private void richTextBox1_Click(object sender, EventArgs e)
- {
- System.Diagnostics.Process.Start("notepad.exe", Application.StartupPath + "\\version.txt");
- }
- private void richTextBox3_Click(object sender, EventArgs e)
- {
- this.Close();
- }
-
- private void OTSSplashScreen_IncA_MouseDown(object sender, MouseEventArgs e)
- {
- //拖动窗体
- this.Cursor = System.Windows.Forms.Cursors.Hand;//改变鼠标样式
- ReleaseCapture();
- SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
- this.Cursor = System.Windows.Forms.Cursors.Default;
- }
- }
- }
|