摘要:
如果在程序中直接更新进度条,是无法响应的。使用BackgroundWorker可以解决该问题。public partial class Form1 : Form{ BackgroundWorker backgroundWorker1 = new backgroundWorker1; public Form1() { InitializeComponent(); Shown += new EventHandler(Form1_Shown); backgroundWorker1.WorkerReportsProgress = t... 阅读全文
摘要:
//传统定义参数属性的方法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;} } 阅读全文
摘要:
Close()函数只能关闭当前窗体。如果要关闭当前程序的所有窗体,可以用:Application.Current.Shutdown(); 阅读全文