标题:一次创建多个label 数组控件
取消只看楼主
味无味
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2013-10-11
结帖率:80%
已结贴  问题点数:20 回复次数:0 
一次创建多个label 数组控件
Option Explicit

Dim labjs As Long


Private Sub Command1_Click()
Dim Label1() As Label
labjs = 1
labjs = labjs + 1
Load Label1(labjs)
With Label1(labjs)
    .Caption = labjs
    .Visible = True
End With
Call label1move

End Sub


Private Sub Label1_Click()
Index As Integer
Unload Label1(Index)
Call label1move
End Sub

Private Sub label1move()
Dim k As Label
Dim x As Long, y As Long
x = 0
y = 0

For Each k In Label1
    k.Move x, y
    x = x + k.Width
    If x + k.Width > Me.ScaleWidth Then
        y = y + k.Height
        x = 0
    End If
Next
End Sub
提示下标越界
2013-10-11 16:52



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-421728-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.185832 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved