vb如何实现1到100的累加,并且累加一次在TEXT中输出一次结果,但是不能覆盖
4个回答
展开全部
private sub Form_Load()
text1.MultiLine=true
end sub
private sub Command1_Click()
dim i as Integer
dim sum as Integer
sum=0
for i=0 to 100
sum=sum+i
if text1.text="" then
text1.text=sum
else
text1.Text=text1.Text & "-"握敬洞(可稿搭以是任意分段枯隔符) & sum
end if
next
end sub
text1.MultiLine=true
end sub
private sub Command1_Click()
dim i as Integer
dim sum as Integer
sum=0
for i=0 to 100
sum=sum+i
if text1.text="" then
text1.text=sum
else
text1.Text=text1.Text & "-"握敬洞(可稿搭以是任意分段枯隔符) & sum
end if
next
end sub
展开全部
Text1属性设置:
Multiline=true
ScrollBars = 2
代世散清码如搜前下:
private sub Command1_Click()
dim i%,掘败mS%
for i=1 to 100
ms=ms+i
text1.Text=text1.text & i & " " & ms & vbcrlf
next i
end sub
Multiline=true
ScrollBars = 2
代世散清码如搜前下:
private sub Command1_Click()
dim i%,掘败mS%
for i=1 to 100
ms=ms+i
text1.Text=text1.text & i & " " & ms & vbcrlf
next i
end sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Command1_Click()
Dim i%,s%
Text1= ""
s=1
For i = 2 to 100
s = s + i
Text1= Text1 & s & vbcrlf
Next i
End Sub
Dim i%,s%
Text1= ""
s=1
For i = 2 to 100
s = s + i
Text1= Text1 & s & vbcrlf
Next i
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Command1_Click()
Dim i As Integer,s as Long
Text1.Text = "腔州"腔搭
For i = 1 to 100
s = s + i
Text1.Text = Text1.Text & CStr(s) & "伍圆拿 "
Next i
'...
End Sub
Dim i As Integer,s as Long
Text1.Text = "腔州"腔搭
For i = 1 to 100
s = s + i
Text1.Text = Text1.Text & CStr(s) & "伍圆拿 "
Next i
'...
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询