wpf控件的MouseEnter事件中设置5秒后隐藏控件
System.Timers.Timer timer = new System.Timers.Timer(5 * 1000);//5秒 timer.Elapsed += new System.Timers.ElapsedEventHandler(delegate (object obj, System.Timers.ElapsedEventArgs el) { this.Dispatcher.Invoke((Action)delegate () { timer.Enabled = false; //实现 }); }); timer.AutoReset = false; timer.Enabled = true;
标签:控件,c#,一段时间,System,timer,Timers,设置 From: https://www.cnblogs.com/fangxinliu/p/16918106.html