OTSSplashScreen_IncA.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using System;
  2. using System.Drawing;
  3. using System.Runtime.InteropServices;
  4. using System.Windows.Forms;
  5. using System.Xml;
  6. namespace OTSMeasureApp._10_OTSSplashScreen
  7. {
  8. public partial class OTSSplashScreen_IncA : Form
  9. {
  10. #region 使窗体可以移动的代码
  11. [DllImport("user32.dll")]
  12. public static extern bool ReleaseCapture();
  13. [DllImport("user32.dll")]
  14. public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int IParam);
  15. public const int WM_SYSCOMMAND = 0x0112;
  16. public const int SC_MOVE = 0xF010;
  17. public const int HTCAPTION = 0x0002;
  18. #endregion
  19. public OTSSplashScreen_IncA()
  20. {
  21. InitializeComponent();
  22. }
  23. private void OTSSplashScreen_Load(object sender, EventArgs e)
  24. {
  25. }
  26. private void label2_Click(object sender, EventArgs e)
  27. {
  28. }
  29. private void richTextBox1_Click(object sender, EventArgs e)
  30. {
  31. System.Diagnostics.Process.Start("notepad.exe", Application.StartupPath + "\\version.txt");
  32. }
  33. private void richTextBox3_Click(object sender, EventArgs e)
  34. {
  35. this.Close();
  36. }
  37. private void OTSSplashScreen_IncA_MouseDown(object sender, MouseEventArgs e)
  38. {
  39. //拖动窗体
  40. this.Cursor = System.Windows.Forms.Cursors.Hand;//改变鼠标样式
  41. ReleaseCapture();
  42. SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
  43. this.Cursor = System.Windows.Forms.Cursors.Default;
  44. }
  45. }
  46. }