如何用vb编写多个控件

[复制链接]
查看11 | 回复1 | 2010-4-14 20:41:18 | 显示全部楼层 |阅读模式
首先要画一个command1,index设置为0Private Sub Command1_Click(Index As Integer)
Command1(Index).Caption = Index
On Error GoTo Error_hasbeenload
Load Command1(Index + 1)Error_hasbeenload:
Command1(Index + 1).Width = Command1(Index).Width
Command1(Index + 1).Height = Command1(Index).Height
Command1(Index + 1).Top = Command1(Index).Top + Command1(Index).Height
Command1(Index + 1).Caption = Index + 1
Command1(Index + 1).Visible = TrueEnd Sub~
回复

使用道具 举报

千问 | 2010-4-14 20:41:18 | 显示全部楼层
你可以一个一个添加,或者使用控件组比如for i = 1 to 10text1(i).text="第" & i & "个text控件"next i这里面是一个控件组,有10个控件,空间名相同均为 text1,但是每个控件之间有标识,就是text1后面的(i)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行