VB6实例图文教程(新手入门)

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

VB-HelloWorld!vbVB,,VBVB1_1VB4.03212ToolsBoxVB3VBForm4PropertiesVBText5VBVBProjectFormBasClassVbpHelloworldWin95VBCtrlPictureBox(Name)PictureBoxPicture1Picture1PicturePicture1VBBitMapWMFICOVBIconsmisc\face01.icoPicture1Pictrue1Autosize1-TruePicture1BorderStyle0-NonePicture2Pictureface02.icoPicture3Pictureface03.icoOptionButtonCaption1_2TextBoxText1_3VBVBVB1_4VBVBProcedureFunctionForm_Load()Autoexec.batVB.PrivateSubForm_Load()Picture1.Visible=FalsePicture2.Visible=FalsePicture3.Visible=FalseText1.Visible=FalseText2.Visible=FalseText3.Visible=FalseEndSubPrivateSubEndSubVisibleTrueFalseVB1.VBAbcABCVB2.Ctrl+CCtrl+TCtrl+PF51_5PrivateSubForm_Load()Picture1.Visible=FalsePicture2.Visible=FalsePicture3.Visible=FalseText1.Visible=FalseText2.Visible=FalseText3.Visible=FalseOption4.Left=-2000Option4.Value=TrueEndSubLeft2000Value=True1_6.Option4.Visible=FalseValueObjectOption1ProcClickOption1_ClickPrivateSubOption1_Click()Picture1.Visible=TruePicture2.Visible=FalsePicture3.Visible=FalseText1.Visible=TrueText2.Visible=FalseText3.Visible=FalseText1.Text=EndSubOption2_ClickOption2_ClickPrivateSubOption2_Click()Picture2.Visible=TruePicture1.Visible=FalsePicture3.Visible=FalseText2.Visible=TrueText1.Visible=FalseText3.Visible=FalseText2.Text=EndSubPrivateSubOption3_Click()Picture3.Visible=TruePicture2.Visible=FalsePicture1.Visible=FalseText3.Visible=TrueText2.Visible=FalseText1.Visible=FalseText3.Text=Hello,WorldEndSubF5^_^VB-vbVBMouseMove1.PaintPaintAutoDrawTrue1PaintResizeResizeLoadUnload2.FocusGotFocusLostFocusFocusGotFocusLostFocus3.ClickDbClickMouseDownMouseUp/MouseMoveDragDropMouseDownMouseMoveMouseUpDragOverDragOver4.KeyDownKeyUp/KeyPress5.ChangeChangeTextBoxDropDownComboBoxPathChangeFileBox6.TimerNameNameVBInterger241.VBInteger-3276832767Long-2,147,483,6482,147,483,647Single-3.37E+383.37E+38Double-1.67E+3081.67E+308String065,535BooleanTrue/-1False/02.DimDimAsDimIndexAsIntegerDimIndexAsInteger,DimNumberAsLongDimIndex,NumberAsInteger%&!#DimIndex%DimIndexAsIntegerConstConstCOLOR=255DimIntegerArray(99)AsInteger100099DimIntegerArray(2to10)AsInteger210DimThreeD(4,2to5,3to6)AsInteger(444)TypeTypeAsAsAs,,,,,,,,,,EndTypeTypeAddressStreetAsStringZipCodeAsStringPhoneAsStringEndTypeDimMyHomeAsAddressMyHome.,,,WithWithMyHome.Street=.ZipCode=100037.Phone=12345678EndWithVB-VBvbVBBasicVBVisualBasicBasicBasicVBVBBasicVBVBFunctionVBBasicVBVBDeclareDLLDimRedimVBRemDOSDimaAsStringRemDimaAsStringCVBVB_VBIf,,Then,,IfThen,,,EndIfCVBThenIfThenEndIfIfThenElseEndIfElseIfIfThenElseIfElseEndIf1TrueFalse12TrueFalse23TrueFalse,,,,,,,,,,,,NTrueFalseNN1ElseSelectVBSelectSelectCaseCase1,,Case2,,Case3,,,,,,CaseElse,,EndSelectSelectCasea%Case1Printa=1Case2Printa=2CaseElsePrintadoesnotequalto1or2.EndSelectCforVBForVBForFor=To[Step],,,,NextStep1StepDima=0ForI=1To10a=a+INextI110aDima=0ForI=10To1Step1a=a+INextIWhileDoWhile,,LoopWhile,,WendDo,,LoopWhileWhileDoWhile,,LoopWhile,,WendWhileDo,,LoopWhileDoWhileUntilWhileWhileUntilWhileUntilWhileNotForWhlie*/ModaModbab^A^BABVB===ABNotAAndOrXorEqvImpTTFTTFTTTFFFTTFFFTTFTTFTFFTFFFTTTTrueFFalseVBCommand1_Click()VBVB-vbVBVBWindowsclickCommandButton41NameCommand1cmdExitCaptionPrivateSubcmdExit_Click()UnloadMeEndSubF542ClickUnloadMe43ListTextCommand1Command2List1CaptionText1Text)Button1CaptionEnabledFalseButton2Caption=Button1EnabledFalseCommand1F544GeneralDimStoreStringAsString'VBPrivateSubCommand1_Click()Text1.Text=StoreStringCommand1.Enabled=FalseEndSubPrivateSubCommand2_Click()StoreString=Text1.TextText1.Text='Command1.Enabled=TrueEndSub45Undo/RedoButton2Button1EnabledTrueCaptionPrivateSubCommand1_Click()IfCommand1.Caption=ThenStoreString=Text1.TextText1.Text='Command1.Caption=ElseText1.Text=StoreStringCommand1.Caption=EndIfEndSubWindowsVBForm1TextText11717Command1IndexCommand1Command1CopyPaste17Text1BackColor&H00C0FFFF&Text0.Command1Index016Index09Caption=09Index10Caption=.Index11Caption==Index12Caption=+Index13Caption=-Index14Caption=Index15Caption=Index16Caption=Font1.2.3.4.IndexGeneralDimNum1,Num2AsSingleDimStrNum1,StrNum2AsStringDimFirstNumAsBoolean'Text1Num1Num2StrNum1StrNum2Form_LoadNum1=0Num2=0StrNum1=StrNum2=FirstNum=True17SelectCasePrivateSubCommand1_Click(IndexAsInteger)SelectCaseIndexCase0To9IfFirstNumThenStrNum1=Str(Index)FirstNum=FalseElseStrNum1=StrNum1+Str(Index)EndIfText1.Text=StrNum1EndSelectEndSubGeneralDimPointFlagAsBoolean'Form_LoadPointFlag=FalseCommandCase10IfNotPointFlagThenIfFirstNumThenStrNum1=0.FirstNum=FalseElseStrNum1=StrNum1+.EndIfElseExitSubEndIfPointFlag=TrueText1.Text=StrNum1GeneralDimRunsignAsInteger'DimSignFlagAsBoolean'Form_LoadRunsign=0SignFlag=FalseCommand1_ClickCase12To15FirstNum=TruePointFlag=False'IfSignFlagThenCallRunElseSignFlag=TrueStrNum2=StrNum112StrNum1=1EndIfRunsign=Index-11ProcedureGeneralAddProcedureRunSubRun()Num1=Val(StrNum2)Num2=Val(StrNum1)SelectCaseRunsignCase1equal=Num1+Num2Case2equal=Num1-Num2Case3equal=Num1*Num2Case4equal=Num1/Num2EndSelectStrNum2=Str(equal)StrNum1=StrNum2Text1.Text=StrNum2En

1 / 124
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功