谁会vb编程啊 帮帮我 谢谢拉

谁会vb编程啊 帮帮我 谢谢拉,第1张

Private Sub Command1_Click()

Dim weight As Double

Dim hight As Double

Dim std As Double

Dim range As Double

weight = InputBox("输入体重kg")

hight = InputBox("输入身高cm")

std = hight - 105 '标准

range = std 01 '允许范围

If weight >= range + std Then

MsgBox "偏胖"

Else

If weight <= std - range Then

MsgBox "偏瘦"

Else

MsgBox "正常"

End If

End If

End Sub

Dim 身高, 体重

Private Sub Command1_Click()

End

End Sub

Private Sub Form_Load()

Form1Caption = "体型测试"

End Sub

Private Sub Text1_Change(Index As Integer)

Select Case Index

Case 0

体重 = Text1(Index)Text

Case 1

身高 = Text1(Index)Text

End Select

If 身高 = "" Then P = 0 Else P = 体重 / 身高 105

Select Case P

Case Is < 1

Label4Caption = "太瘦"

Case P >= 1 And P < 115

Label4Caption = "有点瘦"

Case P >= 115 And P < 145

Label4Caption = "标准"

Case P >= 145 And P < 16

Label4Caption = "有点胖"

Case Is >= 16

Label4Caption = "太胖"

End Select

End Sub

控件和界面你自己搞吧 ,text1是文本框数组,0——体重,1——身高

Private Sub Command1_Click()

Text1Text = Val(InputBox("请输入身高"))

Text2Text = Val(InputBox("请输入体重"))

End Sub

dim sg as integer

dim tz as long

dim sjtz as long

sg=text1text

sjtz=text2text

if sg<166 then tz=sg-100

if sg>=166 and sg<=175 then tz=sg-105

if sg>=176 and sg<=185 then tz=sg-110

if sg>185 then tz=sg-115

s=sjtz/tz

if s>005 then

text3text="胖"

else

text3text="正常"

endif

以上就是关于谁会vb编程啊 帮帮我 谢谢拉全部的内容,包括:谁会vb编程啊 帮帮我 谢谢拉、VB select case 体型测试 代码、怎样VB编程等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zz/10107071.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-05
下一篇 2023-05-05

发表评论

登录后才能评论

评论列表(0条)

保存