有意思的问题,来拿分!!

make11111 2002-08-28 04:06:25
我在form1上放了3个button,分别是command1(0),command1(1),command2
然后写了如下代码:
Private Sub Form_Load()
Dim mycontrol As Control

Set mycontrol = Form1.Controls("command2")

mycontrol.Caption = "111"
End Sub
但是如果把第3行改为:
Set mycontrol = Form1.Controls("command1")

Set mycontrol = Form1.Controls("command1(0)")
就不行,请帮我实现怎么来控制这个控件数组!!
...全文
28 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
make11111 2002-08-28
  • 打赏
  • 举报
回复
thank you!
cool_man 2002-08-28
  • 打赏
  • 举报
回复
将第三行改为
Set mycontrol = Form1.Controls("command1")(0)
make11111 2002-08-28
  • 打赏
  • 举报
回复
人呢?

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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