VS2005中listbox如何使用?

VS2005中listbox如何使用?,第1张

listBox1.Items.Clear() //清除listBox中的item;

listBox1.Items.Count //获取listBox的item数目

listBox1.Items[n] /和前竖/获取listBox中的第n个item

listBox1.Items.Add("123") /唤大/向listBox中悔裤添加一个item

string[] tmp1 = System.IO.Directory.GetFiles(dialog1.SelectedPath, "*.jpg "含简纯)

改咐碧为

string[] tmp1 = System.IO.Directory.GetFiles(dialog1.SelectedPath)

就行了。。。谈咐。

for(int ii=0ii<dt.Rows.Countii++){ ListItem li=new ListItem(dt.Rows[ii]["显示腊简的text列"].ToString(),dt.Rows[ii]["旅局念filename"].ToString())this.ListBox1.Items.Add(li)} 取值拆困: this.ListBox1.SelectedValue.ToString()


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/tougao/8166024.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-14
下一篇 2023-04-14

发表评论

登录后才能评论

评论列表(0条)

保存