急!如何设置Button单击

appleyounger 2008-06-12 11:07:33
Private Sub SetToolBarState(ByVal bState As Boolean)
'设置Button的是否能够单击
ToolBar1.Buttons("0").Enabled = bState
ToolBar1.Buttons("1").Enabled = bState
ToolBar1.Buttons("2").Enabled = bState
ToolBar1.Buttons("3").Enabled = bState
ToolBar1.Buttons("4").Enabled = bState
ToolBar1.Buttons("5").Enabled = bState
ToolBar1.Buttons("6").Enabled = bState
ToolBar1.Buttons("7").Enabled = Not bState
ToolBar1.Buttons("8").Enabled = Not bState
End Sub
出现异常,未将对象引用设置到对象的实例。如何改正?
...全文
59 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Jeffery_Wong 2011-11-17
  • 打赏
  • 举报
回复
出现buttons不是……的函数的成员…………
appleyounger 2008-06-12
  • 打赏
  • 举报
回复
谢谢了~
ba527 2008-06-12
  • 打赏
  • 举报
回复
有这种写法吗?
feiyun0112 2008-06-12
  • 打赏
  • 举报
回复
ToolBar1.Buttons(0).Enabled = bState

index不要引号


*****************************************************************************
欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码)
http://feiyun0112.cnblogs.com/

16,717

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧