摘要: 如果在程序中直接更新进度条,是无法响应的。使用BackgroundWorker可以解决该问题。public partial class Form1 : Form{ BackgroundWorker backgroundWorker1 = new backgroundWorker1; public Form1() { InitializeComponent(); Shown += new EventHandler(Form1_Shown); backgroundWorker1.WorkerReportsProgress = t... 阅读全文
posted @ 2013-01-08 20:43 马语者 阅读(8985) 评论(2) 推荐(1) 编辑
摘要: //传统定义参数属性的方法public class MyClass{ private int _age; public int Age { get{ return _age; } set{ _age = value; } }}//如果get, set逻辑简单,可使用自动属性public class MyClass{ public int Age {get; set;} } 阅读全文
posted @ 2013-01-08 19:04 马语者 阅读(292) 评论(0) 推荐(0) 编辑
摘要: Close()函数只能关闭当前窗体。如果要关闭当前程序的所有窗体,可以用:Application.Current.Shutdown(); 阅读全文
posted @ 2013-01-08 18:47 马语者 阅读(6582) 评论(0) 推荐(0) 编辑