I am beginner in c#/.net, so please tell me how to use BackgroundWorker rather then Application.DoEvent.
This is my code:
while (webBrowser1.ReadyState!= WebBrowserReadyState.Complete)
{
Application.DoEvents(); //how to use "BackgroundWorker" here
if (webBrowser1.ReadyState == WebBrowserReadyState.Complete)
{
listBox1.Items.RemoveAt(listBox1.SelectedIndex);
listBox1.SelectedIndex = 0;
var num = listBox1.Items.Count;
string str = Convert.ToString(num);
label2.Text = str;
}
}