在VB中,当列表框中没有选定的项目时,按钮不可操作的代码
来源:百度知道 编辑:UC知道 时间:2024/05/15 13:33:13
在form_onload里面加上
button1.enable=false
然后再列表框中的点击事件中加上
if not list1.ListIndex=-1 then
button.enable=true
end if
list1.ListIndex=-1时就是没选中了。
按钮默认不可用
list1的click里加按钮可操作的代码 b.enable=true