这个VB有什么问题

[复制链接]
查看11 | 回复2 | 2008-11-29 10:28:15 | 显示全部楼层 |阅读模式
Option Explicit
Dim V%, JS!
Private Sub Command1_Click()
V = Combo1.Text
Timer1.Enabled = True
JS = 0
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Set Picture = LoadPicture("VB 背景 1.bmp")
Label1.Caption = "演示火箭匀速垂直运动"
Label2.Caption = "选择速度 米/秒"
Label3.Caption = "升空时间 秒"
Label5.Caption = "速度 米/秒"
Label7.Caption = "升空高度 米"
Label4.Caption = ""
Label6.Caption = ""
Label8.Caption = ""
Command1.Caption = "发射按钮"
Command2.Caption = "结束按钮"
Combo1.AddItem (Str(10))
Combo1.AddItem (Str(20))
Combo1.AddItem (Str(30))
Combo1.AddItem (Str(40))
Combo1.AddItem (Str(50))
Combo1.Text = 30
Picture1.Picture = LoadPicture("China 火箭.bmp")
Picture1.AutoSize = True
Timer1.Enabled = False
Timer1.Interval = 10
End Sub
Private Sub Timer1_Timer()
Dim H!
JS = JS + 1
H = V * JS
Picture1.Top = Form11.Height - Picture1.Height - H - 300
Labe14.Caption = JS
Labe16.Caption = V
Labe18.Caption = H
If Picture1.Top <= 0 Then
Timer1.Enabled = False
End If
End Sub
框框我已经设了
Picture1.Top = Form11.Height - Picture1.Height - H - 300
中说Form11和Picture1变量未设定

回复

使用道具 举报

千问 | 2008-11-29 10:28:15 | 显示全部楼层
你的窗体应该为form11,所以检查一下窗体名是否为form11窗体上是否有一个picture的图像控件!没有重建一个!不要建错!要建立那个名为picture的不要建image!...
回复

使用道具 举报

千问 | 2008-11-29 10:28:15 | 显示全部楼层
Form11.Height 改成:Form1.Height Labe14.Caption = JS 改成:LabeL4.Caption = JS '注意1与L Labe16.Caption = V 改成:LabeL6.Caption = V'注意1与L Labe18.Caption = H 改成:LabeL8.Caption = H '注意1...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行