您好,欢迎访问三七文档
当前位置:首页 > 电子/通信 > 数据通信与网络 > 初二信息技术(下)VB程序设计全教案
1;23451231212[]a3h2.5[][]1000,:,[]11322.534123[][]112123[][]1000[][][]10[][][]1234512341[]21[]Form1Command1Command2Label1Label2Text1Text272[]10[]form1captionform1caption123NameCaptionEnabledVisibleHeightWidthLeft/TopForeColorBackColorFont3WindowsClickDblClickMouseDownMouseMoveKeyPressLoad3112Form1CaptionForm1BackColorGreenLabel1fontCommand1caption3PrivateSubButton1_Click(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesButton1.ClickLabel1.Text=EndSubPrivateSubForm1_DoubleClick(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesMe.DoubleClickEndEndSub451231231234112)34523254Form1Label1Image1Label112Form1ClickLabel1MouseMoveLabel1ClickLabel1DblClickImage1mousemovePrivateSubLabel1_Click(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesLabel1.ClickMe.CreateGraphics().DrawEllipse(Pens.Black,20,20,100,100)EndSubPrivateSubLabel1_DoubleClick(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesLabel1.DoubleClickMe.CreateGraphics().Clear(Me.BackColor)EndSubPrivateSubLabel1_MouseMove(ByValsenderAsObject,ByValeAsSystem.Windows.Forms.MouseEventArgs)HandlesLabel1.MouseMoveLabel1.Text=EndSubPrivateSubPictureBox1_MouseMove(ByValsenderAsObject,ByValeAsSystem.Windows.Forms.MouseEventArgs)HandlesPictureBox1.MouseMoveLabel1.Text=EndSubPrivateSubForm1_Click(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesMe.ClickEndEndSub5123Label14Form1.ClsClsForm1ClsVB12[]:3[](a0)4132356Form1Text1AText2BText3CText4X1Text5X2Command1Command2Label1X+Label22Label3X+Label4=0Label5X1=Label6X2=1VB234captiontextcaptionlabel1captionX+;font712PrivateSubButton1_Click(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesButton1.ClickDimaAsDoubleDimbAsDoubleDimcAsDoubleDimx1AsDoubleDimx2AsDoublea=TextBox1.Textb=TextBox2.Textc=TextBox3.Textx1=(-b-Math.Sqrt(b*b-4*a*c))/(2*a)x2=(-b+Math.Sqrt(b*b-4*a*c))/(2*a)TextBox4.Text=x1TextBox5.Text=x2EndSubPrivateSubButton2_Click(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesButton2.ClickEndEndSub891231text1text2text3text4text52)3a,b,c12--VBVB123VB&+VBr3.14163.1416r[][][]integerlongsingledoubleBooleanstringDate3[][]VB[]Abs(x)XInt(x)XSqr(x)XRnd(x)[01]Val(x)Str(x)Abs(86)86Abs(-86)86Int(8.001)8Int(8.999)8Int(-8.999)-9Sqr(64)8^A^2a/(a-c)68Abs(x-y)+68Int(x/10)m,nM+nVB123EndRem41212()1--------X1=(-b+Sqr(b*b-4*a*c))/(2*a)X2=(-b-Sqr(b*b-4*a*c))/(2*a)VBA=22=aX=1X=2()xVBX=1X=2PrintxX2()X=1y=x()x()VBX=1y=xPrintxX1()2.=VBForm1.caption=Command1.caption=1XYX=6:Y=868X=888X=X+1982XYTX=5:Y=656T=X565X=Y665Y=T655--------123[][]a=ba=bba,a,a,ba,b31VB25label1,label2,label3,label4,label5.4text1,text2,text3,text4.2command1,command2.Form1captionLabel1CaptionA:Label2CaptionB:Label3CaptionLabel4CaptionA:Label5CaptionB:Text1TextText2TextText3TextText4textCommand1CaptionCommand2Caption[]a,b:T=aA=bB=tPrivateSubButton1_Click(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesButton1.ClickDimaAsDoubleDimbAsDoubleDimtAsDoublea=TextBox1.Textb=TextBox2.Textt=aa=bb=tTextBox3.Text=aTextBox4.Text=bEndSubPrivateSubButton2_Click(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesButton2.ClickEndEndSub51212341[]66Abs(x):XInt(x):XSqr(x):XRnd(x):[01]Val(x):Str(x):21R116R229R1R2/(R1+R2).3[][]R1R2341VB233235[]3R1R2RDoubleVBR1R2R1+R2R1R2R116R229R1+R2162945R1R2RDoubleVal()R1R2R1+R2(val(R1)+val(R2))PrivateSubButton1_Click(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesButton1.ClickDimr1AsDoubleDimr2AsDoubleDimrAsDoubler1=TextBox1.Textr2=TextBox2.Textr=r1*r2/(r1+r2)TextBox3.Text=rEndSubPrivateSubButton2_Click(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesButton2.ClickEndEndSub672A30%B30%C40%8692900.3A+0.3B+0.4C81VB234229PrivateSubButton1_Click(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesButton1.ClickDimaAsDoubleDimbAsDoubleDimcAsDoubleDimsAsDoublea=TextBox1.Textb=TextBox2.Textc=TextBox3.Texts=0.3*a+0.3*b+0.4*cTextBox4.Text=sEndSubPrivateSubButton2_Click(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesButton2.ClickEndEndSub101Val()212341211232a=3a=b3abaabb[]IfthenAElseBEndifIfthenAEnd12IfThenElseEnd3AB===(true)(false)12a100,b20AbTrueA=(b+20)FalseabTrueA=bFalseabFalseabTrue12.22a100b20andOrnota200andb=20Falsea=100andb10TrueA=bandb10Falsea200orb=20Truea=100orb10TrueA=borb10FalseNot(a200andb=20)TrueNot(a200orb=20)False123VBVBIfthenAElseBEndifIfthenAEnd10X/10=int(X/10)212:DimaAsDoubleDimbAsDoublea=TextBox1.Textb=TextBox2.TextIfabThenA=bEndIfLabel4.Text=aDimaAsDoubleDimbAsDoublea=TextBox1.Textb=TextBox2.TextIfabThenLabel4.Text=aElseLabel4.Text=bEndIf[][]12VB12345123vbvbvb51001vb3vbVB11intervalEnabled2timer21231interval2timerTimer1.Nametimer2.Enabled3.intervalms1000ms=1s0timer1~65535Timertimer47Label1.BackColor=#000000Label1.Font=36Form1.Caption=timer1.Interval=1000PrivateSubTimer1_Timer()Label1.Caption=TimeEndSub1timetime$2Interval1Enabled2Fontsizeexe.exe,;(RGB)(red)(green)(blue)RGB8bit0~25525624bit0~255:00:0:255255:2552550:0MinMax:Value:1colorr=Hscroll1.valuerg=,,b=,,Text1.backcolor=RGB(r,g,b)RGB,r,g,btext12changecolor12r,g,b3.exe,
本文标题:初二信息技术(下)VB程序设计全教案
链接地址:https://www.777doc.com/doc-2457150 .html