Dim c As Integer
For c = 0 To Val(Form1.Text3.Text)
Label11(k).Caption = "Form1.Text4.Text" & Val(Form1.Text1.Text) + c
Next c我这样是错的为什么?
For c = 0 To Val(Form1.Text3.Text)
Label11(k).Caption = "Form1.Text4.Text" & Val(Form1.Text1.Text) + c
Next c我这样是错的为什么?
For c = 0 To Val(Form1.Text3.Text)-1
Label11(c+k).Caption = Form1.Text4.Text & Val(Form1.Text1.Text) + c
Next c
如果Label11是从0开始赋,则k=0.
dim strx2 as string
dim strx as string
dim xx as integer
strx1 = text1.text
for xx = 1 to cint(text2.text) '// 自己检查数据是否有效
strx1 = strx1 & xx & vbcrlf '//增加了换行显示
next
lable.caption = strx1
你要的效果
1,一个lable显示两行
for i=0 to c
lbl.caption=lbl.caption & text1.text & cint(text2.text)+i & vbcrlf
next i
2.两个lable每个显示一行,首先这个要看你的lable数组的下标是否一致了。如果lable的下标从k开始
for i=0 to c-1
lbl(k+i)=caption=text1.text & cint(text2.text)+i & vbcrlf
next i
Dim c As Integer
Dim i As Integer
Label1.Caption = ""
Text1.Text = "Text"
Text2.Text = "2"
c = 5
For i = 0 To c - 1
Label1.Caption = Label1.Caption & Text1.Text & CStr(Val(Text2.Text) + i) & vbCrLf
Next i
End Sub