listbox Refresh() in c#

前端 未结 10 2410
梦毁少年i
梦毁少年i 2020-12-30 10:54
int[] arr = int[100];
listBox1.DataSource = arr;
void ComboBox1SelectedIndexChanged(object sender, EventArgs e)
{
    .....//some processes
    listBox1.DataSource =         


        
10条回答
  •  星月不相逢
    2020-12-30 11:45

    Use BeginUpdate and EndUpdate, that should solve it. No need to set the data source twice

    listBox1.BeginUpdate();
    
    listBox1.DataSource = myList;
    
    listBox1.EndUpdate();
    

提交回复
热议问题