M
Mihajlo Cvetanović
Consider this sample code:
public class MainForm : Form
{
private System.Windows.Forms.ComboBox myComboBox;
private void myComboBox_DropDown(object sender, EventArgs e)
{
Thread.Sleep(5000);
myComboBox.Items.Clear();
myComboBox.Items.Add("abc");
}
}
I have some processing instead of Sleep, but Sleep produces the same
effect: drop down portion of combo box disappears the first time I try
to display it. Every other time the list is properly displayed. If the
pause is 4000 ms then the list is displayed even the first time. Anyone
has an explanation about this? How can I prevent the list from
disappearing even the first time?
public class MainForm : Form
{
private System.Windows.Forms.ComboBox myComboBox;
private void myComboBox_DropDown(object sender, EventArgs e)
{
Thread.Sleep(5000);
myComboBox.Items.Clear();
myComboBox.Items.Add("abc");
}
}
I have some processing instead of Sleep, but Sleep produces the same
effect: drop down portion of combo box disappears the first time I try
to display it. Every other time the list is properly displayed. If the
pause is 4000 ms then the list is displayed even the first time. Anyone
has an explanation about this? How can I prevent the list from
disappearing even the first time?