Using VC# 2008, in WinXP 32 bit, the following function
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
textBoxURL.Text = webBrowser1.Url.ToString();
if (bStart)
{
string strData= webBrowser1.DocumentText;
int iIndex = listBox1.Items.IndexOf(strID);
if (strData.Contains("No news found"))
{
listBox1.SetSelected(iIndex, false);
listBox1.Items[iIndex] = getID((string)listBox1.Items[iIndex]);
}
else
{
listBox1.Items[iIndex] = getID((string)listBox1.Items[iIndex]) + "; ONLINE";
if (!listBox1.GetSelected(iIndex))
{
timer2.Enabled = true;
listBox1.Items[iIndex] = getID((string)listBox1.Items[iIndex]) + "; MOVING";
}
}
timer1.Interval = iTime + rand.Next(iTimeVar);
timer1.Enabled = true;
}
}
When the listbox1.SetSelected(iIndex,false) line executes, the function just seems to return right there. Same with any of the lines that access listbox member functions.
Is that supposed to happen? Is there some way around that?