for (int i = 0; i < this.listBox1.Items.Count - 1; i++)
{
if (this.listBox1.Items[i].Selected == true)
{
this.listBox1.Items.RemoveAt(i);
}
}listBox1.Items[i].的后面只会显示:四个属性Equals、GetHashCode、GetType、ToString;没有Selected的属性。
这是为什么呢?
{
if (this.listBox1.Items[i].Selected == true)
{
this.listBox1.Items.RemoveAt(i);
}
}listBox1.Items[i].的后面只会显示:四个属性Equals、GetHashCode、GetType、ToString;没有Selected的属性。
这是为什么呢?
解决方案 »
- 代码混淆器
- 遇到一个奇怪的问题,在TabControl中的控件鼠标都变成了手(Hand)的图标
- 请问web服务引用-高级-里的“始终生成消息合同”有什么作用?
- 请问“frm.ShowDialog(this) == DialogResult.OK”是什么意思?
- 关于Properties.Resources的问题
- 刚开始学.net, 为什么新建一个工程时老是报一个错误信息,跪求答案
- c#中,textbox1中的时间+textbox2中的时间=textbox3中的时间问题?
- 求一算法(关于合理放置的问题)
- .net2005下,C#语言怎么控制摄像头
- c#中小写转大写怎么写?
- Microsoft Visual Studio .NET 2003 能否编辑C语言
- 为什么?
*****************************************************************************
欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码)
http://feiyun0112.cnblogs.com/
this.listBox1.Items.RemoveAt(this.listBox1.SelectedIndex);
{ ListBox2.Items.Clear();
string path = ListBox1.SelectedItem.Value;
string[] fileName = Directory.GetDirectories(path);
foreach (string f in fileName)
{
string temp;
temp = f.Substring(3);
ListBox2.Items.Add(temp);
}
}
获取所有ListBox的选中的Items,要使用ListBox.SelectedItems 属性