Article ID: 113999
Article Last Modified on 10/29/2003
Sub Form_Load()
Picture1.AutoRedraw = True
Picture1.BackColor = &H80000003&
Picture1.DrawMode = 10
Picture1.FillStyle = 0
Picture1.ForeColor = &H00000080
End Sub
Dim tenth as Long
' Enter the following Declare statement as one, single line:
Declare Function BitBlt Lib "GDI" (ByVal hDestDC As Integer,
ByVal X As Integer, ByVal Y As Integer, ByVal nWidth As Integer,
ByVal nHeight As Integer, ByVal hSrcDC As Integer,
ByVal XSrc As Integer, ByVal YSrc As Integer, ByVal dwRop As Long)
As Integer
Sub UpdateStatus (FileBytes As Long)
'--------------------------------------------------------------------
' Update the Picture1 status bar
'--------------------------------------------------------------------
Static progress as long
Const SRCCOPY = &HCC0020
Dim Txt$
progress = progress + FileBytes
If progress > Picture1.ScaleWidth Then
progress = Picture1.ScaleWidth
End If
Txt$ = Format$(CLng((progress / Picture1.ScaleWidth) * 100)) + "%"
Picture1.Cls
' Enter the following two lines as one, single line of code:
Picture1.CurrentX =
(Picture1.ScaleWidth - Picture1.TextWidth(Txt$)) \ 2
' Enter the following two lines as one, single line of code:
Picture1.CurrentY =
(Picture1.ScaleHeight - Picture1.TextHeight(Txt$)) \ 2
Picture1.Print Txt$
' Enter the following two lines as one, single line of code:
Picture1.Line (0,0)-(progress,Picture1.ScaleHeight),
Picture1.ForeColor,BF
' Enter the following two lines as one, single line of code:
r = BitBlt(Picture1.hDC, 0, 0,Picture1.ScaleWidth,
Picture1.ScaleHeight, Picture1.hDC, 0, 0, SRCCOPY)
End Sub
Sub Command1_Click ()
Picture1.ScaleWidth = 109
tenth = 10
For i = 1 to 10
Call UpdateStatus(tenth)
x = timer
While Timer < x + .75
doevents
Wend
Next
End Sub
Additional query words: 3.00 vb3only
Keywords: KB113999