以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]如何删除ListBox中的项目?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=29541)

--  作者:红颜
--  发布时间:2013/3/8 16:28:00
--  [求助]如何删除ListBox中的项目?

Dim lst As WinForm.ListBox = e.form.Controls("ListBox1")
Dim Count As Integer = DataTables("SFMX").Compute("Count(ZT)","DY = 0")
If Count > 0 Then
    Dim Arys As List(Of String())
    Arys = DataTables("SFMX").GetUniqueValues("", "BH","BRXM","MC")
    For Each Ary As String() In Arys
        lst.items.Add(ary(0) & "," & ary(1) & "," & ary(2))
    Next
End If

 

上面代码放在窗口按钮中,没按一次,就会生成重复的项目。如何在点击按钮后先清空ListBox中的项目items,然后再生成新的项目。


图片点击可在新窗口打开查看此主题相关图片如下:未命名.jpg
图片点击可在新窗口打开查看
[此贴子已经被作者于2013-3-8 16:57:54编辑过]

--  作者:狐狸爸爸
--  发布时间:2013/3/8 16:37:00
--  
lst.items.Clear