开发工具:
文件大小: 4kb
下载次数: 0
上传时间: 2010-07-17
详细说明: Option Explicit Const Pi = 3.1415926 Public b As Integer Dim p() As Single, q() As Single Private Sub Timer1_Timer() Text1 = Rnd * 201 + 100 '生成随机数 Text2 = Rnd * 101 + 20 b = b + 1 ReDim Preserve p(b) '定义两个一维数组用以保存生成的随机树 ReDim Preserve q(b) p(b) = Val(Text1) q(b) = Val(Text2) Shpblue.Height = Text1 * 7 '改变蓝色控件的高度模拟反应釜内液面变化 Shpblue.Top = 2200 + 5880 - Text1 * 7 If b Mod 50 = 0 And b >= 50 Then '在图片框控件中画 出对应的曲线 Picture1.Cls Else Picture1.Line (80 * (b Mod 50 - 1), 3000 - p(b - 1) * 10)-(80 * (b Mod 50), 3000 - p(b) * 10), &HFF Picture1.Line (80 * (b Mod 50 - 1), 3000 - q(b - 1) * 10)-(80 * (b Mod 50), 3000 - q(b) * 10), &HFF0000 End If End Sub Private Sub Text1_Change() Dim a As String * 20, c As String * 20 Open "D:\bjz.txt" For Input As #1 Line Input #1, a Line Input #1, c If Val(Text1.Text) > a Then Label3.Caption = "液位超上限" Else: Label3.Caption = "" End If Close #1 End Sub Private Sub Text2_Change() Dim e As String * 20, f As String * 20 Open "D:\bjz.TXT" For Input As #1 Line Input #1, e Line Input #1, f If Val(Text2.Text) > f Then Label4.Caption = "温度超上限" Else: Label4.Caption = "" End If Close #1 End Sub Private Sub cmd1_Click() Form2.Show '窗体2出现 End Sub Private Sub cmd2_Click() Dim m As Integer Open "d:\data.txt" For Output As #2 '保存数据 Print #2, "时间(s), 温度(℃), 液体(cm)" Close #2 For m = 1 To b Open "D:\data.txt" For Append As #3 Write #3, m, p(m), q(m) Close #3 Next End Sub Private Sub cmd3_Click() End '结束程序 End Sub Private Sub Form_Activate() Circle (3340, 8080), 700, vbBlue, -Pi, -2 * Pi ' Circle (3340, 5880), 700, vbRed, -2 * Pi, -Pi End Sub ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.