自由国度

.Net、C#、WPF、Silverlight、HTML5、JavaScript等,好好写代码。

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2010年10月25日

摘要: 原文在.Net中有不少计时器,包括:1.System.Threading.Timer2.System.Timers.Timer3.System.Windows.Forms.Timer4.System.Web.UI.Timer5.System.Windows.Threading.DispatcherTimer其中第四个主要用于web开发中;第一个和第二个的触发事件和UI处于不同的线程,因此如果使用它们的触发事件来改变UI,会发生对象被占用的异常;第三个是WinForm的计时器,在WPF中也可以使用,不过必须添加System.Windows.Forms的引用;第五个是WPF自己的计时器,一般在WP 阅读全文
posted @ 2010-10-25 21:44 彬子 阅读(2969) 评论(0) 推荐(0) 编辑

摘要: //验证输入为数字 private void txt_time_KeyDown(object sender, KeyEventArgs e) { if (!((e.Key >= Key.D0 && e.Key <= Key.D9) || (e.Key >= Key.NumPad0 && e.Key <= Key.NumPad9))) { e.... 阅读全文
posted @ 2010-10-25 15:07 彬子 阅读(7528) 评论(0) 推荐(0) 编辑