首页 行业资讯 宠物日常 宠物养护 宠物健康 宠物故事

各位VB高手进来看看吧。。。可追加分数!!

发布网友 发布时间:2024-10-22 04:36

我来回答

3个回答

热心网友 时间:2024-11-08 19:31

dim sumA as double
dim sumB as double
sub A()
dim InputNum as double
dim i as integer
for i= 1 to val(text1)
InputNum=val(inpubox("输入"))
labelA.caption=labelA.caption & InputNum & vbcrlf
sumA=sumA+InputNum
end sub
sub B()
dim InputNum as double
dim i as integer
for i= 1 to val(text2)
InputNum=val(inpubox("输入"))
labelB.caption=labelABcaption & InputNum & vbcrlf
sumB=sumB+InputNum
end sub
sub C()
labelC.caption="A中之和:" & sumA & vbcrlf & "B中之和:" & sumA
左边的label.caption=abs(sumA-sumB)
end sub
private sub cmdA_click()
A
end sub
private sub cmdB_click()
B
end sub
private sub cmdC_click()
C
end sub

纯手写,调试下

热心网友 时间:2024-11-08 19:31

你是要代码还是要设计方法?

热心网友 时间:2024-11-08 19:32

dim i as integer

private sub cmdA_click()
for i = 1 to val(text1.text)
labelA.caption = inputbox("请输入") & " "
next
end sub

private sub cmdB_click()
for i = 1 to val(text2.text)
labelB.caption = inputbox("请输入") & " "
next
end sub

private sub cmdC_click()
dim a() as integer
a = split(labelA.caption," ")
for i = 0 to ubound(a)
c = c + a(i)
next
b = split(labelB.caption," ")
for i = 0 to uboubd(b)
d = d + b(i)
next
label.caption = abs(c - d)
end sub

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com