我正在制作一个反病毒软件,但我在ComboBox上遇到了一个问题.当我运行这个应用程序时,上面写着:System.ArgumentOutOfRangeException:'InvalidArgument=Value of '0‘对'SelectedIndex’不#en0#有效。参数名称: SelectedIndex'Private Sub Form1_Load(ByVal sender As System.Object, ByVa
这个错误是由调用根据我所读到的,此指令引发的错误表示试图访问空列表(或数组?)下面是我发出这条指令的方法:public bool deleteItem() if (invList.SelectedItems.Count == 0)= MessageBox.Show(
"Are you sure you want to delet
我需要以编程的方式创建它,设置一个DataSource,将它添加到我的表单中,然后更改SelectedIndex。DataSource = new List<string>(comboBoxDataSource),Form1.Controls.Add(cb);当程序到达最后一行时,我抛出一个错误:
System.ArgumentOutOfRangeException:'4‘的InvalidArgument=Va
newItemIndex = listbox.Items.Count - 1; // this returns the right index of the new added item这里我得到了System.ArgumentOutOfRangeException ( '0‘的InvalidArgument=Value对于’SelectedIndex‘无效。)