DarkTitleShadowForm.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using Y.Skin.YoForm.NoTitle;
  10. using Y.Skin.YoForm.Shadow;
  11. using Y.Utils.WindowsUtils.APIUtils;
  12. namespace Y.Skin.YoForm.CustomTitle
  13. {
  14. public partial class DarkTitleShadowForm : ShadowForm
  15. {
  16. public DarkTitleShadowForm()
  17. {
  18. InitializeComponent();
  19. }
  20. private void DarkTitleForm_Load(object sender, EventArgs e)
  21. {
  22. PBHeadIcon.Image = Icon.ToBitmap();
  23. }
  24. /// <summary>
  25. /// 拖动窗口移动
  26. /// </summary>
  27. /// <param name="sender"></param>
  28. /// <param name="e"></param>
  29. private void LBHeadTitle_MouseMove(object sender, MouseEventArgs e)
  30. {
  31. if (e.Button == MouseButtons.Left)
  32. {
  33. FormStyleAPI.ReleaseCapture();
  34. FormStyleAPI.SendMessage(Handle, FormStyleAPI.WM_NCLBUTTONDOWN, FormStyleAPI.HTCAPTION, 0);
  35. }
  36. }
  37. /// <summary>
  38. /// 最小化
  39. /// </summary>
  40. /// <param name="sender"></param>
  41. /// <param name="e"></param>
  42. private void BTFormMinBox_Click(object sender, EventArgs e)
  43. {
  44. UIMin();
  45. }
  46. /// <summary>
  47. /// 最大化及还原
  48. /// </summary>
  49. /// <param name="sender"></param>
  50. /// <param name="e"></param>
  51. private void BTFormMaxBox_Click(object sender, EventArgs e)
  52. {
  53. UIMax();
  54. }
  55. /// <summary>
  56. /// 关闭
  57. /// </summary>
  58. /// <param name="sender"></param>
  59. /// <param name="e"></param>
  60. private void BTFormCloseBox_Click(object sender, EventArgs e)
  61. {
  62. UIClose();
  63. }
  64. private void DarkTitleShadowForm_SizeChanged(object sender, EventArgs e)
  65. {
  66. DrawShadow();
  67. }
  68. }
  69. }