vb中双击使列表框其中的一个项目使其消失的代码怎么写
1个回答
展开全部
'前提:给窗体加个 listbox 名为:list1
Private Sub Form_Load()
Me.List1.AddItem "a"
Me.List1.AddItem "b"
Me.List1.AddItem "c"
Me.List1.AddItem "d"
Me.List1.AddItem "e"
Me.List1.AddItem "f"
Me.List1.AddItem "g"
Me.List1.AddItem "h"
Me.List1.AddItem "i"
Me.List1.AddItem "j"
Me.List1.AddItem "k"
End Sub
Private Sub List1_DblClick()
Me.List1.RemoveItem Me.List1.ListIndex
End Sub
Private Sub Form_Load()
Me.List1.AddItem "a"
Me.List1.AddItem "b"
Me.List1.AddItem "c"
Me.List1.AddItem "d"
Me.List1.AddItem "e"
Me.List1.AddItem "f"
Me.List1.AddItem "g"
Me.List1.AddItem "h"
Me.List1.AddItem "i"
Me.List1.AddItem "j"
Me.List1.AddItem "k"
End Sub
Private Sub List1_DblClick()
Me.List1.RemoveItem Me.List1.ListIndex
End Sub
追问
Private Sub list1_dblclick()
Me.List1.RemoveItem
Me.List1 .ListIndex
End Sub
能帮我检查一下吗?这样写怎么不对啊
追答
你那么写,代码逻辑是错的,要按照vb的代码逻辑写程序
按照我的写的看它的代码逻辑
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询