// i dont know how to do this in vb.net backgroundWorker1.DoWork += work;
// long operation private void LongOp(object sender, DoWorkEventArgs e) {// for...} // show progressdialog private void button1_Click(object sender, EventArgs e) { // pass method WaitOrProgressDialog w = new WaitOrProgressDialog("Test", LongOp); w.ShowDialog(); }
public partial class WaitOrProgressDialog : Form { public WaitOrProgressDialog(string aTitle, DoWorkEventHandler work) { InitializeComponent(); this.Text = aTitle; // How to make this in VB.NET? backgroundWorker1.DoWork += work; } }
AddHandler BackgroundWorker1.DoWork, AddressOf work.Invoke BackgroundWorker1.RunWorkerAsync()
' First define the Event, then the delegate Method. AddHandler backgroundWorker1.DoWork, AddressOf work
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)