急!如何设置Button单击
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
出现异常,未将对象引用设置到对象的实例。如何改正?
[解决办法]
ToolBar1.Buttons(0).Enabled = bState
index不要引号
*****************************************************************************
欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码)
http://feiyun0112.cnblogs.com/