首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VB Dotnet >

急怎么设置Button单击

2011-12-30 
急!如何设置Button单击Private Sub SetToolBarState(ByVal bState As Boolean)设置Button的是否能够单击T

急!如何设置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/

热点排行