修改并测试成功!!!!!!!!
Private Sub Form_Load()
Form1.AutoRedraw = True
Form1.Height = 8000
Form1.Width = 8000
Form1.Scale (-100, -100)-(100, 100)
Line1.X1 = 0: Line1.Y1 = 0
Line2.X2 = 0: Line2.Y1 = 0‘......>>>Line2.X1 = 0: Line2.Y1 = 0
Line3.X1 = 0: Line3.Y1 = 0
Line1.BorderColor = RGB(0, 0, 0)
Line1.BorderWidth = 3
Line2.BorderColor = RGB(0, 0, 255)
Line2.BorderWidth = 2
Line3.BorderColor = RGB(255, 0, 0)
Line3.BorderWidth = 1
Shape1.Top = -95
Shape1.Left = -95
Shape1.Width = 190
Shape1.Height = 190
Shape1.BorderStyle = 3
Shape1.BorderWidth = 3
Shape1.BorderColor = RGB(0, 0, 255)
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
sx = Sin((180 - 6 * Second(Time)) * 3.14159 / 180) * 65
sy = Cos((180 - 6 * Second(Time)) * 3.14159 / 180) * 65
Line3.X2 = sx
Line3.Y2 = sy
mx = Sin((180 - 6 * Minute(Time)) * 3.14159 / 180) * 65
my = Cos((180 - 6 * Minute(Time)) * 3.14159 / 180) * 65
Line2.X2 = mx
Line2.Y2 = my
hx = Sin((180 - (30 * Hour(Time) + 30 * Minute(Time) / 60)) * 3.14159 / 180) * 40
hy = Cos((180 - (30 * Hour(Time) + 30 * Minute(Time) / 60)) * 3.14159 / 180) * 40
Line1.X2 = hx
Line1.Y2 = hy
Form1.CurrentX = -2
Form1.CurrentY = 80
Form1.Print "6"
Form1.CurrentX = -2
Form1.CurrentY = -80
Form1.Print "12"
Form1.CurrentX = 75
Form1.CurrentY = -8
Form1.Print "3"
Form1.CurrentX = -80
Form1.CurrentY = -8
Form1.Print "9"
End Sub
Scale用于标示对象的坐标系统,其中前一组数字表示Picture1的左上角的坐标值,后一组数字表示Picture1的右下角的坐标值。因此如果你将左上角的坐标和右下角的坐标值设置为同一个坐标,则VB会认为你设置有误,会报“除数为零”的错误。
..........张志晨..............