能否不在窗口中创一个LABEL控件的前提下,用语句创建多组控件组标签? 如凭空创建LABEL1(X),LABEL2(X)等
能否不在窗口中创一个LABEL控件的前提下,用语句创建多组控件组标签?如凭空创建LABEL1(X),LABEL2(X)等二楼的回答不错,第二个题又来了,我建有有PICTU...
能否不在窗口中创一个LABEL控件的前提下,用语句创建多组控件组标签? 如凭空创建LABEL1(X),LABEL2(X)等
二楼的回答不错,第二个题又来了,我建有有PICTURE BOX,要将生成的LABEL加载于BOX中,如何加进入,使他从属于图片框?回答完毕,追加分! 展开
二楼的回答不错,第二个题又来了,我建有有PICTURE BOX,要将生成的LABEL加载于BOX中,如何加进入,使他从属于图片框?回答完毕,追加分! 展开
2个回答
展开全部
答第二问
'假设你的picturebox 的名称是picture1
dim lab as label
sub form_load()
set lab=controls.add("vb.label","lab",picture1) '关键位置
lab.caption="Loumou的标签,从属于picture1"
lab.move 100,100
lab.autosize=true
lab.visible=true
end sub
=======以下第一问================================================
Dim Label1() As Label
Dim Label2() As Label
Private Sub Form_Load()
Dim i%
ReDim Preserve Label1(5)
ReDim Preserve Label2(5)
For i = 0 To 5
Set Label1(i) = Controls.Add("VB.Label", "label1" & i)
Set Label2(i) = Controls.Add("VB.Label", "label2" & i)
With Label1(i)
.Caption = "Loumou动态标签" & i
.Move 200, 300 * (i + 1)
.AutoSize = True
.Visible = True
End With
With Label2(i)
.Caption = "Loumou动态标签2" & i
.Move 2000, 300 * (i + 1)
.AutoSize = True
.Visible = True
End With
Next
End Sub
'假设你的picturebox 的名称是picture1
dim lab as label
sub form_load()
set lab=controls.add("vb.label","lab",picture1) '关键位置
lab.caption="Loumou的标签,从属于picture1"
lab.move 100,100
lab.autosize=true
lab.visible=true
end sub
=======以下第一问================================================
Dim Label1() As Label
Dim Label2() As Label
Private Sub Form_Load()
Dim i%
ReDim Preserve Label1(5)
ReDim Preserve Label2(5)
For i = 0 To 5
Set Label1(i) = Controls.Add("VB.Label", "label1" & i)
Set Label2(i) = Controls.Add("VB.Label", "label2" & i)
With Label1(i)
.Caption = "Loumou动态标签" & i
.Move 200, 300 * (i + 1)
.AutoSize = True
.Visible = True
End With
With Label2(i)
.Caption = "Loumou动态标签2" & i
.Move 2000, 300 * (i + 1)
.AutoSize = True
.Visible = True
End With
Next
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询