vb列表框删除选中项目
答:Private Sub List1_Click()List2.AddItem List1.List(List1.ListIndex)List1.RemoveItem (List1.ListIndex)End Sub
答:list1.clear
答:Private Sub Command1_Click()Dim i As IntegerIf Text1.Text <> "" Then For i = 0 To List1.ListCount - 1 If List1.List(i) = Text1.Text Then List1.RemoveItem (i) Exit For End If Next iEnd IfEnd Sub ...
答:用ckear方法 如:List1.clear 这个是清空 或者RemoveItem方法 如:list1.RemoveItem.序号 哈哈~注意看我是谁~
答:'VB6 的例子'请自行添加 List1 和 Command1Option ExplicitPrivate Sub Command1_Click() If List1.ListIndex > -1 Then List1.RemoveItem List1.ListIndex '删除选中的项 End IfEnd SubPrivate Sub Form_Load() List1.AddItem "1" List1.AddItem "2" List1.AddItem ...
答:错在循环的总数上 list1删除1个项目后,list1.listcount已经变小了,但是你的循环仍然是循环到原来的总数,就象本来有10个项目,你删除了1个,还剩9个,但你的循环仍然会去处理第10个项目,自然出错了,至于你第一块代码没有出错,估计是因为没有找到符合条件的项目,没有进行删除操作.你用i=i-1可能是想...
答:e As EventArgs) Handles MyBase.Load With ListBox1 .Items.Add("Basic").Items.Add("C#").Items.Add("C++")End With With ListBox2 .Items.Add("阿衰").Items.Add("小冲").Items.Add("庄裤")End With End Sub 这样可以实现你切换列表框后上一个列表框处于未选中任何项目状态 ...
答:实际是就是在按钮事件里对ListBox项的增加和删除ListBox2.Items.Add(ListBox1.SelectedItem)ListBox1.Items.Remove(ListBox1.SelectedItem)
答:要删除项目,用 RemoveItem方法。若要使项目按字母表排序,在把项目加入到列表中之前将控件的 Sorted 属性设置为 True。在声明部分用 Option Base = 1 语句不会影响 Visual Basic 控件中元素的编号。第一个元素始终为 0。当列表索引值超出列表框的实际条数的范围时,则返回一个零长度字符串 (""),例如,对于 ...
答:若为0,则插入到第一个项目位置;若缺省且Sorted属性为False,则插入到最后一个项目位置;若缺省且Sorted属性为True,则插入到合适的排序位置。RemoveItem从列表框中删除项目,其格式为:ListBox控件名.RemoveItem<索引值>Clear清除列表框中所有项目,其格式为:ListBox控件名.Clear例如添加代码到List1...
网友评论:
袁要15581973951:
VB语言里,删除列表框中指定的项目所使用的方法是什么啊?? -
56160贲弯
: RemoveItem(Index As Integer) VB.ListBox 的成员 从一个 ListBox 或 ComboBox 控件或一个 Grid 控件中的一行中删除一项.例子:List1.RemoveItem (4)
袁要15581973951:
vb 删除文件列表框中指定的选项 -
56160贲弯
: Private Sub Command1_Click() If File1.ListIndex-1 Then Kill File1.List(File1.ListIndex) File1.Refresh End Sub
袁要15581973951:
vb中怎样删除列表框中指定的内容 -
56160贲弯
: '首选用查询语句 Stud_rs.Open "" & App.Path & "\jqqcmrgl.文件名 where 项目='" & Text1.Text & "'", resu_con, adOpenStatic, adLockOptimistic, adCmdTable If Text1(5).Text = "" Or Text1.Text = "" Then'查询指定语句是否为空 If Stud_...
袁要15581973951:
VB中如何删除选中的listbox中的项目
56160贲弯
: Private Sub Command1_Click()List1.RemoveItem (List1.ListIndex)End Sub Private Sub Form_Load() For i = 1 To 50 List1.AddItem i Next iEnd Sub
袁要15581973951:
vb如何删除文件列表框中的项目? -
56160贲弯
: 你是删除的文件本身吧?用kill删除以后,file1.refresh 或者是 file1.removeitem file1.refresh
袁要15581973951:
vb怎么删除任意选中的文本框的内容(任务是这样:单击“删除”清除列表框中选定的内容) -
56160贲弯
: 这个很简单啊: 单击'删除'事件代码里写上,text1.text='' text2.text='' 不就自动就空了.
袁要15581973951:
VB listbox删除指定内容 -
56160贲弯
: if list1.listindex > -1 thenlist1.removeitem list1.listindexlist1.listindex = list1.listcount - 1 end if
袁要15581973951:
在VB中删除列表框中所有项目的方法是什么? -
56160贲弯
: Clear 方法(Clipboard、ComboBox、ListBox) 用于清除 ListBox,ComboBox 或系统剪贴板的内容.语法object.Clearobject 所在处代表一个对象表达式,其值为“应用于”列表中的一个对象.说明绑定到 Data 控件的 ListBox 或 ComboBox 控件不支持 Clear 方法.
袁要15581973951:
用VB编写一个为列表框添加删除选项 -
56160贲弯
: VB6.0中可使用AddItem 方法将项目添加到 ListBox 或 ComboBox 控件中.也可使用 RemoveItem 方法从 ListBox 或 ComboBox 控件中删除项目. AddItem 方法:用于将项目添加到 ListBox 或 ComboBox 控件,或者将行添加到 MS Flex Grid控件...
袁要15581973951:
VB,如果List框设置为可多项选择,删除其中被选中的项目一: -
56160贲弯
: for 在执行循环是 他的 最大值是不会变化的 就是说 如果 开始执行是 List1.ListCount - 1= 9 那么 就会循环到9次.但是当 发现一个 List1.Selected(i) = True 后, list1就会删除一条 那么这个时候 List1.ListCount - 1 就会减少一条 = 8 那么当i累计到 9的时候List1.Selected(i)是会报错的,因为List1里面没有这么多条了