打印本文 打印本文 关闭窗口 关闭窗口
VB创建多线程应用程序(二)
作者:武汉SEO闵涛  文章来源:敏韬网  点击数2943  更新时间:2009/4/23 16:37:42  文章录入:mintao  责任编辑:mintao
   Form1.Show

End Sub

 

Public Sub Fillleft()

       Static Bkgcolor As Long

       Dim LongTick As Long, Longcounter As Long

       On Error Resume Next

       For Longcounter = 0 To 3000

           DoEvents

           Bkgcolor = Longcounter Mod 256

           Form1.Picture1.BackColor = RGB(Bkgcolor, 0, 0)

           LongTick = GetTickCount

           While GetTickCount - LongTick < 10             ''''延时10毫秒,下同

           Wend

       Next

       Set myThreadleft = Nothing  ''''如果循环结束则终止当前线程运行,下同

End Sub

 

Public Sub Fillright()

       Static Bkgcolor As Long

       Dim LongTickValue As Long, Longcounter As Long

       On Error Resume Next

       For Longcounter = 0 To 3000

           DoEvents

           Bkgcolor = Longcounter Mod 256

           Form1.Picture2.BackColor = RGB(0, Bkgcolor, 0)

           LongTickValue = GetTickCount

           While GetTickCount - LongTickValue < 10

           Wend

       Next

Set myThreadright = Nothing

End Sub

 

Public Sub Fillbottom()

       Static Bkgcolor As Long

       Dim LongTick As Long, Longcounter As Long

       On Error Resume Next

       For Longcounter = 0 To 3000

           DoEvents

           Bkgcolor = Longcounter Mod 256

        

上一页  [1] [2] [3] [4] [5]  下一页

打印本文 打印本文 关闭窗口 关闭窗口