发布网友 发布时间:2024-10-21 14:26
共2个回答
热心网友 时间:2天前
20QB! ‘’‘’‘’‘’‘’‘先加载一个控件,然后以这个控件为基础,逐个load 数组控件,直到完成,每隔10控件改变一个控件的相对位置...
Option Explicit
Private Sub Form_Load()
Command1(0).Width = 1000
Command1(0).Height = 500
Dim I As Long
For I = 1 To 119
Load Command1(I)
Command1(I).Width = 1000
Command1(I).Height = 500
If I Mod 10 = 0 Then
Command1(I).Left = Command1(I - 1).Left + 1100
Command1(I).Top = Command1(0).Top
Else
Command1(I).Left = Command1(I - 1).Left
Command1(I).Top = Command1(I - 1).Top + 550
End If
Command1(I).Caption = I
Command1(I).Visible = True
Command1(I).Enabled = True
Next
End Sub
热心网友 时间:2天前
在窗体上放入一个Command1,将其Index属性设为0。代码如下:
Private Sub Form_Load()
Dim i As Integer
For i = 0 To 99
If i > 0 Then
Load Command1(i)
Command1(i).Visible = True
End If
Command1(i).Caption = i + 1
Command1(i).Move (i Mod 10) * 450 + 30, (i \ 10) * 300 + 30, 420, 270
Next
End Sub