In my C # application, I run the program by reading an HTML page and parsing some links from it and putting them in a richTextBox (for now). But the problem is that since it needs to read links, it takes some time, so when I run the program, it takes about 5 seconds to display the form. What I would like to do is show the form immediately and show the load cursor or disabled richTextBox. How should I do it? Here is an example of what is happening:
public Intro()
{
InitializeComponent();
WebClient wc = new WebClient();
string source = wc.DownloadString("http://example.com");
HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
doc.LoadHtml(source);
var nodes = doc.DocumentNode.SelectNodes("//a[starts-with(@class, 'url')]");
foreach (HtmlNode node in nodes)
{
HtmlAttribute att = node.Attributes["href"];
richTextBox1.Text = richTextBox1.Text + att.Value + "\n";
}
}
source
share