// *********************************************************************** // Assembly : HZH_Controls // Created : 08-08-2019 // // *********************************************************************** // // Copyright by Huang Zhenghui(黄正辉) All, QQ group:568015492 QQ:623128629 Email:623128629@qq.com // // // Blog: https://www.cnblogs.com/bfyx // GitHub:https://github.com/kwwwvagaa/NetWinformControl // gitee:https://gitee.com/kwwwvagaa/net_winform_custom_control.git // // If you use this code, please keep this note. // *********************************************************************** using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace HZH_Controls.Forms { /// /// Class FrmWaiting. /// Implements the /// /// public partial class FrmWaiting : FrmBase { /// /// Gets or sets the MSG. /// /// The MSG. public string Msg { get { return label2.Text; } set { label2.Text = value; } } /// /// Initializes a new instance of the class. /// public FrmWaiting() { base.SetStyle(ControlStyles.UserPaint, true); base.SetStyle(ControlStyles.AllPaintingInWmPaint, true); base.SetStyle(ControlStyles.DoubleBuffer, true); InitializeComponent(); } /// /// Handles the Tick event of the timer1 control. /// /// The source of the event. /// The instance containing the event data. private void timer1_Tick(object sender, EventArgs e) { if (this.label1.ImageIndex == this.imageList1.Images.Count - 1) this.label1.ImageIndex = 0; else this.label1.ImageIndex++; } /// /// Handles the VisibleChanged event of the FrmWaiting control. /// /// The source of the event. /// The instance containing the event data. private void FrmWaiting_VisibleChanged(object sender, EventArgs e) { //this.timer1.Enabled = this.Visible; } /// /// Does the escape. /// protected override void DoEsc() { } /// /// Handles the Tick event of the timer2 control. /// /// The source of the event. /// The instance containing the event data. private void timer2_Tick(object sender, EventArgs e) { base.Opacity = 1.0; this.timer2.Enabled = false; } /// /// Shows the form. /// /// The int sleep. public void ShowForm(int intSleep = 1) { base.Opacity = 0.0; if (intSleep <= 0) { intSleep = 1; } base.Show(); this.timer2.Interval = intSleep; this.timer2.Enabled = true; } } }