PrivateSubCommand1_Click()IfVal(Text1)1000ThenText2=Text1ElseIf1000=Val(Text1)AndVal(Text1)2000ThenText2=0.9*Val(Text1)ElseIf2000=Val(Text1)AndVal(Text1)3000ThenText2=0.8*Val(Text1)ElseText2=0.7*Val(Text1)EndIfEndSubPrivateSubCommand2_Click()Text1=Text2=Text1.SetFocusEndSubPrivateSubCommand1_Click()Dima,b,ca=Val(Text1)b=Val(Text2)c=Val(Text3)Ifb*b-4*a*c0ThenMsgBox该一元二次方程无解,,警告Text1=Text2=Text3=Text1.SetFocusElseIfb*b-4*a*c=0ThenText4=-b/2*aText5=-b/2*aElseText4=(b+Sqr(b*b-4*a*c))/-2*aText5=(b-Sqr(b*b-4*a*c))/-2*aEndIfEndSubPrivateSubCommand2_Click()EndEndSubPrivateSubqin_Click()Text1=Text2=Text3=Text4=Text5=Text1.SetFocusEndSubPrivateSubCommand1_Click()DimiAsStringi=Text3SelectCaseiCase+Text4=Val(Text1)+Val(Text2)Case-Text4=Val(Text1)-Val(Text2)Case×Text4=Val(Text1)*Val(Text2)Case÷Text4=Val(Text1)/Val(Text2)CaseElsem=MsgBox(输入的操作符无效,请重新输入,1+48,警告)Ifm=1ThenText3=Text3.SetFocusElseEndEndIfEndSelectEndSubPrivateSubCommand2_Click()EndEndSubPrivateSubCommand3_Click()Text1=Text2=Text3=Text4=Text1.SetFocusEndSubPrivateSubForm_Load()Dimx,y,zForm1.AutoRedraw=Truex=Val(InputBox(输入x,x))y=Val(InputBox(输入y,y))z=Val(InputBox(输入z,z))PrintTab(10);x;Tab(18);y;Tab(26);zPrintPrint排序前;Tab(8);x;Tab(16);y;Tab(24);zIfxyThent=y:y=x:x=tIfxzThent=z:z=x:x=tIfyzThent=z:z=y:y=tPrintPrint排序后;Tab(8);x;Tab(16);y;Tab(24);zEndSubPrivateSubCommand1_Click()Text1=Text2=Text3=Text4=Text1.SetFocusEndSubPrivateSubText2_LostFocus()Dima,ia=Val(Text2)IfaMod2=0Anda0ThenElsei=MsgBox(脚数必须≥2倍的头数,请重新输入,2+48,sy2-5)Ifi=4ThenText2=Text2.SetFocusElseIfi=3ThenEndElseEndIfEndIfEndSubPrivateSubText3_lostfocus()IfVal(Text3)=0AndFix(Val(Text3))=Val(Text3)AndText1AndText2ThenText3=(4*Val(Text1)-Val(Text2))/2EndIfIfVal(Text3)0ThenMsgBox鸡的只数不能为负值,,警告Text3=Text1.SetFocusEndIfIfVal(Text3)0AndFix(Val(Text3))Val(Text3)ThenMsgBox鸡的只数不能为小数,,错误信息Text3=Text1.SetFocusEndIfEndSubPrivateSubText4_lostfocus()IfVal(Text4)=0AndFix(Val(Text4))=Val(Text4)AndText1AndText2ThenText4=(Val(Text2)-2*Val(Text1))/2EndIfIfVal(Text4)0ThenMsgBox兔的只数不能为负值,,警告Text4=Text2.SetFocusEndIfIfVal(Text4)0AndFix(Val(Text4))Val(Text4)ThenMsgBox兔的只数不能为小数,,错误信息Text4=Text1.SetFocusEndIfEndSub