[院校资料]VisualBasic程序设计—实验报告册-参考答案.doc_第1页
[院校资料]VisualBasic程序设计—实验报告册-参考答案.doc_第2页
[院校资料]VisualBasic程序设计—实验报告册-参考答案.doc_第3页
[院校资料]VisualBasic程序设计—实验报告册-参考答案.doc_第4页
[院校资料]VisualBasic程序设计—实验报告册-参考答案.doc_第5页
已阅读5页,还剩55页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

实验一VERSION 5.00Begin VB.Form Form1 Caption = Form1 ClientHeight = 3195 ClientLeft = 60 ClientTop = 345 ClientWidth = 4680 LinkTopic = Form1 ScaleHeight = 3195 ScaleWidth = 4680 StartUpPosition = 3 窗口缺省 Begin VB.CommandButton Command1 Caption = Command1 Height = 375 Left = 2640 TabIndex = 0 Top = 2400 Width = 1575 EndEndAttribute VB_Name = Form1Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalsePrivate Sub Command1_Click() Print Sqr(8), 8 (1 / 3)End SubVERSION 5.00Begin VB.Form Form1 Caption = Form1 ClientHeight = 3195 ClientLeft = 60 ClientTop = 345 ClientWidth = 4680 LinkTopic = Form1 ScaleHeight = 3195 ScaleWidth = 4680 StartUpPosition = 3 窗口缺省 Begin VB.CommandButton Command1 Caption = Command1 Height = 495 Left = 3720 TabIndex = 0 Top = 2640 Width = 855 EndEndAttribute VB_Name = Form1Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalsePrivate Sub Command1_Click() Dim i% For i = 100 To 110 Print i, i (1 / 2) NextEnd SubVERSION 5.00Begin VB.Form Form1 AutoRedraw = -1 True Caption = Form1 ClientHeight = 3195 ClientLeft = 60 ClientTop = 345 ClientWidth = 4680 BeginProperty Font Name = 楷体_GB2312 Size = 21.75 Charset = 134 Weight = 400 Underline = 0 False Italic = 0 False Strikethrough = 0 False EndProperty ForeColor = &H000000FF& LinkTopic = Form1 ScaleHeight = 3195 ScaleWidth = 4680 StartUpPosition = 3 窗口缺省EndAttribute VB_Name = Form1Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalsePrivate Sub Form_Load() Print: Print Print 郑州大学在前进!End SubVERSION 5.00Begin VB.Form Form1 Caption = Form1 ClientHeight = 3780 ClientLeft = 60 ClientTop = 345 ClientWidth = 6285 LinkTopic = Form1 ScaleHeight = 3780 ScaleWidth = 6285 StartUpPosition = 3 窗口缺省 Begin VB.Label Label1 Caption = 蓝天、白云、绿水、青山 BeginProperty Font Name = 宋体 Size = 21.75 Charset = 134 Weight = 400 Underline = 0 False Italic = 0 False Strikethrough = 0 False EndProperty ForeColor = &H00FF0000& Height = 975 Left = 600 TabIndex = 0 Top = 1080 Width = 4935 EndEndAttribute VB_Name = Form1Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = False实验2VERSION 5.00Begin VB.Form Form1 Caption = Form1 ClientHeight = 3090 ClientLeft = 60 ClientTop = 450 ClientWidth = 3615 BeginProperty Font Name = 宋体 Size = 12 Charset = 134 Weight = 700 Underline = 0 False Italic = 0 False Strikethrough = 0 False EndProperty LinkTopic = Form1 ScaleHeight = 3090 ScaleWidth = 3615 StartUpPosition = 3 窗口缺省 Begin VB.CommandButton Command2 Caption = 商 Height = 375 Left = 1920 TabIndex = 4 Top = 1680 Width = 975 End Begin VB.CommandButton Command1 Caption = 乘积 Height = 375 Left = 600 TabIndex = 3 Top = 1680 Width = 975 End Begin VB.TextBox Text2 Height = 375 Left = 1920 TabIndex = 2 Top = 840 Width = 1095 End Begin VB.TextBox Text1 Height = 375 Left = 480 TabIndex = 1 Top = 840 Width = 1095 End Begin VB.Label Label3 BorderStyle = 1 Fixed Single Caption = Label3 Height = 375 Left = 2040 TabIndex = 6 Top = 2400 Width = 975 End Begin VB.Label Label2 Caption = 计算结果为: Height = 375 Left = 480 TabIndex = 5 Top = 2400 Width = 1575 End Begin VB.Label Label1 AutoSize = -1 True Caption = 请输入两个数: Height = 240 Left = 960 TabIndex = 0 Top = 360 Width = 1785 EndEndAttribute VB_Name = Form1Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalsePrivate Sub Command1_Click()Label3 = Val(Text1) * Val(Text2)End SubPrivate Sub Command2_Click()Label3 = Val(Text1) / Val(Text2)End SubVERSION 5.00Begin VB.Form Form1 Caption = Form1 ClientHeight = 3090 ClientLeft = 60 ClientTop = 450 ClientWidth = 5490 BeginProperty Font Name = 宋体 Size = 12 Charset = 134 Weight = 700 Underline = 0 False Italic = 0 False Strikethrough = 0 False EndProperty LinkTopic = Form1 ScaleHeight = 3090 ScaleWidth = 5490 StartUpPosition = 3 窗口缺省 Begin VB.CommandButton Command3 Caption = 隐藏 Height = 375 Left = 4080 TabIndex = 3 Top = 2040 Width = 975 End Begin VB.CommandButton Command2 Caption = 图片2 Height = 375 Left = 4080 TabIndex = 2 Top = 1320 Width = 975 End Begin VB.CommandButton Command1 Caption = 图片1 Height = 375 Left = 4080 TabIndex = 1 Top = 600 Width = 975 End Begin VB.PictureBox Picture1 AutoSize = -1 True BeginProperty Font Name = 宋体 Size = 9 Charset = 134 Weight = 400 Underline = 0 False Italic = 0 False Strikethrough = 0 False EndProperty Height = 1935 Left = 600 ScaleHeight = 1875 ScaleWidth = 2715 TabIndex = 0 Top = 480 Width = 2775 EndEndAttribute VB_Name = Form1Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalsePrivate Sub Command1_Click()Picture1.Picture = LoadPicture(d:tu1.jpg)End SubPrivate Sub Command2_Click()Picture1.Picture = LoadPicture(d:tu2.jpg)End SubPrivate Sub Command3_Click()Picture1.Visible = FalseEnd SubVERSION 5.00Begin VB.Form Form1 Caption = 收款机 ClientHeight = 2730 ClientLeft = 60 ClientTop = 450 ClientWidth = 4680 BeginProperty Font Name = 宋体 Size = 12 Charset = 134 Weight = 700 Underline = 0 False Italic = 0 False Strikethrough = 0 False EndProperty LinkTopic = Form1 ScaleHeight = 2730 ScaleWidth = 4680 StartUpPosition = 3 窗口缺省 Begin VB.CommandButton Command1 Caption = 总价为 Height = 375 Left = 600 TabIndex = 4 Top = 1920 Width = 1695 End Begin VB.TextBox Text2 Height = 495 Left = 3000 TabIndex = 3 Top = 960 Width = 1335 End Begin VB.TextBox Text1 Height = 495 Left = 3000 TabIndex = 2 Top = 240 Width = 1335 End Begin VB.Label Label3 Alignment = 2 Center BorderStyle = 1 Fixed Single Height = 495 Left = 2760 TabIndex = 5 Top = 1920 Width = 1455 End Begin VB.Label Label2 Alignment = 2 Center Caption = 货物的单价(元): Height = 375 Left = 360 TabIndex = 1 Top = 1080 Width = 2295 End Begin VB.Label Label1 Alignment = 2 Center Caption = 货物的数量(个): Height = 375 Left = 360 TabIndex = 0 Top = 360 Width = 2295 EndEndAttribute VB_Name = Form1Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalsePrivate Sub Command1_Click()Label3 = Text1 * Text2End SubBegin VB.Form Form1 Caption = Form1 ClientHeight = 1890 ClientLeft = 60 ClientTop = 450 ClientWidth = 4365 LinkTopic = Form1 ScaleHeight = 1890 ScaleWidth = 4365 StartUpPosition = 3 窗口缺省 Begin VB.CommandButton Command2 Caption = 清除 BeginProperty Font Name = 宋体 Size = 12 Charset = 134 Weight = 700 Underline = 0 False Italic = 0 False Strikethrough = 0 False EndProperty Height = 375 Left = 2400 TabIndex = 3 Top = 1200 Width = 975 End Begin VB.CommandButton Command1 Caption = 复制 BeginProperty Font Name = 宋体 Size = 12 Charset = 134 Weight = 700 Underline = 0 False Italic = 0 False Strikethrough = 0 False EndProperty Height = 375 Left = 720 TabIndex = 2 Top = 1200 Width = 975 End Begin VB.TextBox Text2 Height = 495 Left = 2160 TabIndex = 1 Top = 360 Width = 1695 End Begin VB.TextBox Text1 Height = 495 Left = 480 TabIndex = 0 Top = 360 Width = 1455 EndEndAttribute VB_Name = Form1Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalsePrivate Sub Command1_Click()Text2 = Text1End SubPrivate Sub Command2_Click()Text1 = Text2 = End SubPrivate Sub Form_Load()Command1.Visible = FalseCommand2.Visible = FalseEnd SubPrivate Sub Text1_Change()Command1.Visible = TrueCommand2.Visible = TrueEnd SubVERSION 5.00Begin VB.Form Form1 Caption = Form1 ClientHeight = 3300 ClientLeft = 60 ClientTop = 450 ClientWidth = 4695 BeginProperty Font Name = 宋体 Size = 12 Charset = 134 Weight = 700 Underline = 0 False Italic = 0 False Strikethrough = 0 False EndProperty LinkTopic = Form1 ScaleHeight = 3300 ScaleWidth = 4695 StartUpPosition = 3 窗口缺省 Begin VB.Timer Timer1 Enabled = 0 False Interval = 500 Left = 3120 Top = 1320 End Begin VB.CommandButton Command2 Caption = 停止 Height = 495 Left = 2640 TabIndex = 1 Top = 2400 Width = 975 End Begin VB.CommandButton Command1 Caption = 移动 Height = 495 Left = 840 TabIndex = 0 Top = 2400 Width = 1095 End Begin VB.Image Image1 Height = 1800 Left = 840 Top = 360 Width = 1500 EndEndAttribute VB_Name = Form1Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalsePrivate Sub Form_Load() Image1.Picture = LoadPicture(d:tu3.jpg)End SubPrivate Sub Command1_Click() Timer1.Enabled = TrueEnd SubPrivate Sub Command2_Click() Timer1.Enabled = FalseEnd SubPrivate Sub Timer1_Timer() Image1.Left = Int(Rnd * (Form1.ScaleWidth - Image1.Width) Image1.Top = Int(Rnd * (Form1.ScaleHeight - Image1.Height)End Sub实验3VERSION 5.00Begin VB.Form Form1 Caption = Form1 ClientHeight = 3195 ClientLeft = 60 ClientTop = 345 ClientWidth = 4680 LinkTopic = Form1 ScaleHeight = 3195 ScaleWidth = 4680 StartUpPosition = 3 窗口缺省 Begin VB.CommandButton Command1 Caption = Command1 Height = 495 Left = 3720 TabIndex = 0 Top = 2640 Width = 855 EndEndAttribute VB_Name = Form1Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalsePrivate Sub Command1_Click() Print 2 * 3 2 * 8 / 4 + 3 2 Print Sqr(Sqr(64) Print #2/27/2004# - 10 Print Int(-3.1415926) Print Int(Abs(99 - 100) / 2) Print Fix(-3.1415926) Print Int(-3.5), Int(3.5) Print Fix(3.5), Fix(3.5) Print Sgn(7 * 3 + 2) Print LCase(Hello) Print Val(16Year) Print Str(-459.65) Print Len(Hello 程序设计 ok) Print MNT & 123 & ABC Print 123 + Mid(123456, 3, 2) Print 123 & Mid(123456, 3, 2) Print DateAdd(m, 1, #2/27/2004#)End Sub Caption = Form1 ClientHeight = 3195 ClientLeft = 60 ClientTop = 345 ClientWidth = 6825 BeginProperty Font Name = 宋体 Size = 15 Charset = 134 Weight = 700 Underline = 0 False Italic = 0 False Strikethrough = 0 False EndProperty LinkTopic = Form1 ScaleHeight = 3195 ScaleWidth = 6825 StartUpPosition = 3 窗口缺省 Begin VB.TextBox Text1 Height = 495 Left = 3120 TabIndex = 2 Text = Text1 Top = 240 Width = 1695 End Begin VB.CommandButton Command1 Caption = 计算平方立方(根) BeginProperty Font Name = 宋体 Size = 14.25 Charset = 134 Weight = 700 Underline = 0 False Italic = 0 False Strikethrough = 0 False EndProperty Height = 495 Left = 1680 TabIndex = 0 Top = 960 Width = 3015 End Begin VB.Label Label2 Caption = Label2 Height = 735 Left = 480 TabIndex = 3 Top = 1920 Width = 5895 End Begin VB.Label Label1 Caption = 输入一个数 Height = 495 Left = 1320 TabIndex = 1 Top = 240 Width = 1935 EndEndAttribute VB_Name = Form1Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalsePrivate Sub Command1_Click() Dim n% n = Abs(Val(Text1) Label2 = Format(n 2, #.000) & Space(2) & Format(Sqr(n), #.000) & Space(2) & Format(n 3, #.000) & Space(2) & Format(n (1 / 3), #.000)End SubBegin VB.

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论