我用vb在timer1中该怎么调用在form中设的数a

来源:百度知道 编辑:UC知道 时间:2024/06/03 22:02:27

定义之后直接用

在form中设的数a在timer1中是不能调用的。你必须把那个数a在窗体的通用中声明才能在timer1中调用。

在timer的timer事件中调用
下面是我的程序中的一段代码
Private Sub Timer1_Timer()

If Btemp_angle1 > 0 And Btemp_angle1 < 2 * pi Then
Btemp_angle1 = Btemp_angle1 + 0.001
Picture1.Line (Picture1.ScaleWidth / 2 + 22 * Cos(Btemp_angle1), Picture1.ScaleHeight / 2 + 22 * Sin(Btemp_angle1))-(Picture1.ScaleWidth / 2 + 39 * Cos(Btemp_angle1), Picture1.ScaleHeight / 2 + 39 * Sin(Btemp_angle1)), &HFF00&
ElseIf Btemp_angle1 >= 2 * pi Then
Btemp_angle1 = pi / 180
'********************************
Timer1.Enabled = False
Picture1.ScaleMode = 3
Picture1.FillStyle = 0

Picture1.FillColor = &H80000005
Call ExtFloodFill(Picture1.hdc, Picture1.ScaleWidth / 2 + 22, Picture1.ScaleHeigh