资源描述:
《中山医vb课后题实验33》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、中山医vb课后题实验33窗体与基本控件PublicClassForm1(汽油)PrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.ClickDimtAsInteger,fAsSingle,xAsStringt=Val(TextBox1.Text)f=7.69*tx=Str$(f)+"元"Label2.Text=xTextBox1.Focus()EndSubPrivateSubForm1_Load(
2、ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesMe.LoadTextBox1.Text=""Label2.Text=""EndSubEndClassPublicClassForm2(体重超标)PrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.ClickDimxAsIntegerIfTextBox1.Text=""ThenTextBox1.
3、Focus()'在文本框1输入身高MsgBox("请输入身高")ExitSubEndIfIfTextBox2.Text=""ThenTextBox2.Focus()'在文本框2输入体重MsgBox("请输入体重")ExitSubEndIf'选择性别IfRadioButton1.Checked=FalseAndRadioButton2.Checked=FalseThen'此种情况不会发生MsgBox("请选择被检测者性别")ExitSubEndIfIfRadioButton1.Checked=TrueThenx=Val(Tex
4、tBox1.Text)-100'计算男性体重ElseIfRadioButton2.Checked=TrueThenx=Val(TextBox1.Text)-105'计算女性体重EndIf'判断体重是否超标,并显示IfVal(TextBox2.Text)>xThenLabel3.Text="体重超标,请注意饮食与运动!"ElseLabel3.Text="体重正常"EndIfEndSubPrivateSubButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventA
5、rgs)HandlesButton2.Click'清除计算体重和超标提示Label3.Text="":TextBox1.Text="":TextBox2.Text=""RadioButton1.Checked=False:RadioButton2.Checked=FalseEndSubPrivateSubButton3_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton3.ClickEnd'结束工程运行EndSubEndClassPu
6、blicClassForm3(病例信息)DimxAsInteger,varstringAsStringPrivateSubForm1_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.LoadTextBox3.Enabled=FalseButton1.Enabled=FalseTextBox3.Font=NewFont("宋体",10,FontStyle.Regular)EndSubPrivateSubButton3_Click(By
7、ValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton3.ClickEndEndSubPrivateSubButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton2.ClickSelectCaseTrueCaseCheckBox1.Checked=TrueAndCheckBox2.Checked=FalseTextBox3.Font=NewFont("宋
8、体",10,FontStyle.Bold)CaseCheckBox2.Checked=TrueAndCheckBox1.Checked=FalseTextBox3.Font=NewFont("宋体",10,FontStyle.Italic)CaseCheckBox1.CheckedAndC