private void btnSWQuery_Click(object sender, EventArgs e) { if (SWWorker.IsBusy == false) { SWWorker.RunWorkerAsync(); } }
private void SWWorker_DoWork(object sender, DoWorkEventArgs e) { try { SWWorker.ReportProgress(0, "Query Start"); StockQuery query = new StockQuery(); query.QueryStockWarrant(); SWWorker.ReportProgress(0, "Query End"); } catch (Exception ex) { SWWorker.ReportProgress(0, ex.Message); } }