FrmWithOKCancel2.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // ***********************************************************************
  2. // Assembly : HZH_Controls
  3. // Created : 08-08-2019
  4. //
  5. // ***********************************************************************
  6. // <copyright file="FrmWithOKCancel2.cs">
  7. // Copyright by Huang Zhenghui(黄正辉) All, QQ group:568015492 QQ:623128629 Email:623128629@qq.com
  8. // </copyright>
  9. //
  10. // Blog: https://www.cnblogs.com/bfyx
  11. // GitHub:https://github.com/kwwwvagaa/NetWinformControl
  12. // gitee:https://gitee.com/kwwwvagaa/net_winform_custom_control.git
  13. //
  14. // If you use this code, please keep this note.
  15. // ***********************************************************************
  16. using System;
  17. using System.Collections.Generic;
  18. using System.ComponentModel;
  19. using System.Data;
  20. using System.Drawing;
  21. using System.Linq;
  22. using System.Text;
  23. using System.Windows.Forms;
  24. namespace HZH_Controls.Forms
  25. {
  26. /// <summary>
  27. /// Class FrmWithOKCancel2.
  28. /// Implements the <see cref="HZH_Controls.Forms.FrmWithTitle" />
  29. /// </summary>
  30. /// <seealso cref="HZH_Controls.Forms.FrmWithTitle" />
  31. [Designer("System.Windows.Forms.Design.ParentControlDesigner, System.Design", typeof(System.ComponentModel.Design.IDesigner))]
  32. public partial class FrmWithOKCancel2 : FrmWithTitle
  33. {
  34. /// <summary>
  35. /// Initializes a new instance of the <see cref="FrmWithOKCancel2" /> class.
  36. /// </summary>
  37. public FrmWithOKCancel2()
  38. {
  39. InitializeComponent();
  40. }
  41. /// <summary>
  42. /// Handles the BtnClick event of the btnOK control.
  43. /// </summary>
  44. /// <param name="sender">The source of the event.</param>
  45. /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
  46. private void btnOK_BtnClick(object sender, EventArgs e)
  47. {
  48. DoEnter();
  49. }
  50. /// <summary>
  51. /// Handles the BtnClick event of the btnCancel control.
  52. /// </summary>
  53. /// <param name="sender">The source of the event.</param>
  54. /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
  55. private void btnCancel_BtnClick(object sender, EventArgs e)
  56. {
  57. DoEsc();
  58. }
  59. /// <summary>
  60. /// Does the enter.
  61. /// </summary>
  62. protected override void DoEnter()
  63. {
  64. this.DialogResult = System.Windows.Forms.DialogResult.OK;
  65. }
  66. /// <summary>
  67. /// Handles the VisibleChanged event of the FrmWithOKCancel2 control.
  68. /// </summary>
  69. /// <param name="sender">The source of the event.</param>
  70. /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
  71. private void FrmWithOKCancel2_VisibleChanged(object sender, EventArgs e)
  72. {
  73. }
  74. }
  75. }