我在一个声明后,将清除当前在列表框中的所有string/数据,我试过了:
private void cleanlistBox(object sender,EventArgs e) { listBox1.ResetText(); }
尝试安装Windows服务时,InstallUtil.exe被删除
设置进程调度程序的框架
mono mcs'Winforms Hello World'给出编译错误CS006:无法find元数据文件'cscompmgd.dll'
在这个exception消息中引用了什么“配额”:没有足够的配额可用于处理此命令
关于什么
listBox1.Items.Clear();
private void cleanlistBox(object sender,EventArgs e) { listBox1.Items.Clear(); }
这应该工作:
listBox1.Items.Clear();
这应该工作:
private void cleanlistBox(object sender,EventArgs e) { listBox1.Items.Clear( ); }
用这个:
listBox1.Items.Clear();
如果绑定到数据源,它将使用ListBox1.Items.Clear();
在这种情况下,您将不得不清除数据源。 例如,如果它充满了Datatable:
_dt.Clear(); //<-----Here's the ListBox emptied. _dt = _dbHelper.dtFillDataTable(_dt,strsql); lbStyles.DataSource = _dt; lbStyles.displayMember = "YourdisplayMember"; lbStyles.ValueMember = "YourValueMember";
尝试
private void cleanlistBox(object sender,EventArgs e) { ListBox1.Items.Clear(); }
尝试这个:
private void cleanlistBox(object sender,EventArgs e) { listBox1.DataSource = null; listBox1.Items.Clear(); }
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。