医学vb实验练习题复习资料.docx

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
VB 实验代码 VB 实验代码 实验一 实验二 1 Private Sub Command1_Click() Text1 = Text2 = Text3 = End Sub Private Sub Command2_Click() Text3 = Val(Text1) / V al(Text2) End Sub Private Sub Command3_Click() Text1 = Val(Text3) * V al(Text2) End Sub Private Sub Command4_Click() End End Sub 1 Private Sub Command1_Click() Label1 = Text1 End Sub Private Sub Form_Load() Text1.PasswordChar = * Text1.FontSize = 20 Label1.FontSize = 20 Label1.Alignment = 2 Label1.BorderStyle = 1 Label1.BackColor = vbWhite Command1.FontSize = 20 End Sub 2-2 Private Sub Command1_Click() Label1 = 欢迎来到重庆 Command1.Visible = False Command2.Visible = True Private Sub Command2_Click() Label1 = welcome to ChongQing Command2.Visible = False Command1.Visible = True End Sub Private Sub Form_Load() Label1 = 欢迎来到重庆 Label1.Alignment = 2 Command1.Visible = False Command2.Visible = True End Sub 2-3 Private Sub Form_Load() Label1.BackColor = vbRed Label2.BackColor = vbBlue Label3.BackColor = vbGreen Label4.BackColor = vbY ellow End Sub Private Sub Label1_Click() Text1.ForeColor = Label1.BackColor End Sub Private Sub Label2_Click() Text1.ForeColor = Label2.BackColor End Sub Private Sub Label3_Click() Text1.ForeColor = Label3.BackColor End Sub Private Sub Label4_Click() Text1.ForeColor = Label4.BackColor End Sub Private Sub Text1_Change() 实验三 1 Private Sub Command1_Click() Dim R As Single Const Pi As Single = 3.1415926 R = Val(Text1) Label3 = Int(2 * Pi * R * 1000 + 0.5) / 1000 Label5 = In t(Pi * R A 2 * 1000 + 0.5) / 1000 End Sub 3-2 Private Sub Command1_Click() Dim Lx As Long, Ux As Long Lx = Val(Text1) Ux = Val(Text2) Randomize Label3 = Int((Ux - Lx) * Rnd + Lx) End Sub 3-3 Private Sub Command1_Click() Dim x As Integer x = Val(InputBox( 请输入一个整数! )) Picture1.Cls If x Mod 2 = 0 Then Picture1.Print 你输入的数 ; x; 是偶数 Else Picture1.Print 你输入的数 ; x; 是奇数 End If End Sub 3-4 3-5 Private Sub Command1_Click() Dim a As Date a = Now Print 输出结果为: Print Print Format(a, hh:mm:ss AMPM dddd, yyyy-mm-dd) End Sub Private Sub Form_Load() For

文档评论(0)

youbika + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档