各位大哥大姐帮个忙 看下我的程序 运行时是不是出错
解决方案 »
- 请教VB中事务的问题
- 下面这个错误是什么意思?
- 我想一行一行读出文本框中的内容,要怎么做?(online)
- 我在编写一个小程序考生管理的时候遇到问题!想在线求教!拜托各位高手了
- 帮忙:给我个可以下载VB6的地址!
- 水晶报表怎么实现分页统计功能
- 用ado连接odbc的oracle数据原,可以读取数据集,但是无法更新,添加,为什么?
- 小弟是初学者,我的例程上需要DBGrid32.ocx........
- 怎样编写一个程序:使二进制的IP地址与十进制IP地址转换,例如:111111111.11111111.11111111.00000001转换成255.255.255.1
- 如何取得数据库名称、表名等???
- 判断TabStrip当前选中的是第几个TAB
- 在VB6中数据取得问题
下面是代码 Public xe, ye
Private Sub Command1_Click()
Timer1.Enabled = True
End SubPrivate Sub Command2_Click()
Timer2.Enabled = False '够了
Timer1.Enabled = False
Timer3.Enabled = False
End SubPrivate Sub Command3_Click()
End
End SubPrivate Sub Form_Resize()
Refresh
End SubPrivate Sub Timer1_Timer()
Static k '彩色园斑与祝福
k = k + 1
FontSize = 44
FontItalic = True
x0 = ScaleWidth / 5
y0 = ScaleHeight / 3.6
Randomize
ForeColor = RGB(255 * Rnd, 255 * Rnd, 255 * Rnd)
PSet (x0, y0): Print "XX,生日快乐!"
If k > 8 Then PSet (x0 + 130, y0 + 1050): Randomize: ForeColor = RGB(255 * Rnd, 255 * Rnd, 255 * Rnd): Print "冬已至,记得加衣!"
If k > 17 Then PSet (x0 + 560, y0 + 2150): Randomize: ForeColor = RGB(255 * Rnd, 255 * Rnd, 255 * Rnd): Print "Go Go加油!"
Randomize
t = Fix(50 * Rnd)
DrawWidth = tRandomize
x = Round(ScaleWidth * Rnd / 1.01, 3)
Randomize
y = Round(ScaleHeight * Rnd / 1.01, 3)
Randomize
pset (x, y), RGB(255 * Rnd, 255 * Rnd, 255 * Rnd)End SubPrivate Sub Timer2_Timer()
Static x, y, j, k '阿基米德螺线
k = k + 1
DrawWidth = 3
a = 5
f = 0.09
j = j + f
x = x + a * Cos(j) - a * j * Sin(j)
y = y + a * Sin(j) + a * j * Cos(j)
PSet (x + ScaleWidth / 2.5, y + ScaleHeight / 2.1), vbBlue
If k > 460 Then Timer2.Enabled = False: Timer3.Enabled = True
End SubPrivate Sub Timer3_Timer()
Static x1, y1, j, k '三叶玫瑰
DrawWidth = 3
a = 10
f = 0.005
k = k + 1
j = j + f
x1 = x1 + a * (3 * Cos(3 * j) * Cos(j) - Sin(j) * Sin(3 * j))
y1 = y1 + a * (3 * Cos(3 * j) * Sin(j) + Cos(j) * Sin(3 * j))
PSet (x1 + ScaleWidth / 2.5, y1 + ScaleHeight / 2.1), QBColor(8)
If k Mod 25 = 0 Then
xe = CurrentX: ye = CurrentY
PSet (xe, ye)
FontSize = 10: Print "happy"
End If
If k > 650 Then Timer3.Enabled = False
End Sub
下面是代码 Public xe, ye
Private Sub Command1_Click()
Timer1.Enabled = True
End SubPrivate Sub Command2_Click()
Timer2.Enabled = False '够了
Timer1.Enabled = False
Timer3.Enabled = False
End SubPrivate Sub Command3_Click()
End
End SubPrivate Sub Form_Resize()
Refresh
End SubPrivate Sub Timer1_Timer()
Static k '彩色园斑与祝福
k = k + 1
FontSize = 44
FontItalic = True
x0 = ScaleWidth / 5
y0 = ScaleHeight / 3.6
Randomize
ForeColor = RGB(255 * Rnd, 255 * Rnd, 255 * Rnd)
PSet (x0, y0): Print "XX,生日快乐!"
If k > 8 Then PSet (x0 + 130, y0 + 1050): Randomize: ForeColor = RGB(255 * Rnd, 255 * Rnd, 255 * Rnd): Print "冬已至,记得加衣!"
If k > 17 Then PSet (x0 + 560, y0 + 2150): Randomize: ForeColor = RGB(255 * Rnd, 255 * Rnd, 255 * Rnd): Print "Go Go加油!"
Randomize
t = Fix(50 * Rnd)
DrawWidth = tRandomize
x = Round(ScaleWidth * Rnd / 1.01, 3)
Randomize
y = Round(ScaleHeight * Rnd / 1.01, 3)
Randomize
pset (x, y), RGB(255 * Rnd, 255 * Rnd, 255 * Rnd)End SubPrivate Sub Timer2_Timer()
Static x, y, j, k '阿基米德螺线
k = k + 1
DrawWidth = 3
a = 5
f = 0.09
j = j + f
x = x + a * Cos(j) - a * j * Sin(j)
y = y + a * Sin(j) + a * j * Cos(j)
PSet (x + ScaleWidth / 2.5, y + ScaleHeight / 2.1), vbBlue
If k > 460 Then Timer2.Enabled = False: Timer3.Enabled = True
End SubPrivate Sub Timer3_Timer()
Static x1, y1, j, k '三叶玫瑰
DrawWidth = 3
a = 10
f = 0.005
k = k + 1
j = j + f
x1 = x1 + a * (3 * Cos(3 * j) * Cos(j) - Sin(j) * Sin(3 * j))
y1 = y1 + a * (3 * Cos(3 * j) * Sin(j) + Cos(j) * Sin(3 * j))
PSet (x1 + ScaleWidth / 2.5, y1 + ScaleHeight / 2.1), QBColor(8)
If k Mod 25 = 0 Then
xe = CurrentX: ye = CurrentY
PSet (xe, ye)
FontSize = 10: Print "happy"
End If
If k > 650 Then Timer3.Enabled = False
End Sub
t = Fix(50 * Rnd)
DrawWidth = t
当t=0时就会出现drawwidth属性值无效的错误.建议将t = Fix(50 * Rnd)改为t = Fix(50 * Rnd)+1