VB 用sleep时,出现程序无响应

gaofuqi 2009-10-29 01:32:34
水流线画图如下:
Picture1.CurrentX = pen(1).PenPointx Picture1.CurrentY = pen(1).PenPointy
For temp1 = 1 To pointcount - 1
If (pen(temp1).PenPointx = -1 And pen(temp1).PenPointy = -1) Then
Picture1.CurrentX = pen(temp1 + 1).PenPointx
Picture1.CurrentY = pen(temp1 + 1).PenPointy
Else
Picture1.Line -(pen(temp1).PenPointx, pen(temp1).PenPointy )
Sleep (pen(temp1 + 1).time - pen(temp1).time)
End If
Next temp1

pen的定义如下:
Private Type paintpen
PenPointx As Integer 'X轴坐标
PenPointy As Integer 'Y轴坐标
time As Long ‘时间点
End Type

(-1,-1,0)是开始下一笔
怎么我一到下一划的时候就出错了,程序就不动了
大家帮我看看,哪里出问题了
...全文
330 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
清晨曦月 2009-10-29
  • 打赏
  • 举报
回复
Else
Picture1.Line -(pen(temp1).PenPointx, pen(temp1).PenPointy )
Sleep (pen(temp1 + 1).time - pen(temp1).time)
application.doevents
End If
水猿兵团五哥 2009-10-29
  • 打赏
  • 举报
回复
奇怪的
gaofuqi 2009-10-29
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 dylike 的回复:]
不要sleep那句或改成application.doevents
[/Quote]
不要sleep的话,无法控制速度
怎么用application.doevents?
dylike 2009-10-29
  • 打赏
  • 举报
回复
不要sleep那句或改成application.doevents

16,721

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧