VB动态载入控件
建立一个Label1(0to15)的控件数组数组中的每个元素属性如下:Width=200Height=200BackColor=QBColor(各自的下标)Visible...
建立一个Label1(0 to 15)的控件数组
数组中的每个元素属性如下:
Width =200
Height =200
BackColor = QBColor(各自的下标)
Visible = True
排一横排放在Form1上,间距为100
要求只用代码实现 展开
数组中的每个元素属性如下:
Width =200
Height =200
BackColor = QBColor(各自的下标)
Visible = True
排一横排放在Form1上,间距为100
要求只用代码实现 展开
1个回答
展开全部
完全只用代码是不可能的,你必须放置一个Label控件,并且把它的Index设为0(这是关键!),然后:
Private Sub Form_Load()
Dim i As Long
For i = 1 To 15
Load Label1(i)
Next
For i = 0 To 15
Label1(i).BackColor = QBColor(i)
Label1(i).Move i * 300, 100, 200, 200
Label1(i).Visible = True
Next
End Sub
Private Sub Form_Load()
Dim i As Long
For i = 1 To 15
Load Label1(i)
Next
For i = 0 To 15
Label1(i).BackColor = QBColor(i)
Label1(i).Move i * 300, 100, 200, 200
Label1(i).Visible = True
Next
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询