home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "flood"
- Option Explicit
-
- 'para evitar pasar repetidamente una $
- Dim fmsg As String
-
- 'variable de flood
- Dim f As PictureBox
- Public Sub FloodDisplay(upperLimit, floodMessage As String)
-
- 'establecet la variable a nivel del modulo de f
- 'igual a la forma padre
- Set f = frmData.pix
-
- 'inicializar
- 'blanco (color del texto)
- 'negro (el flujo)
- 'llenado s≤lido
- f.BackColor = &HFFFFFF
- f.ForeColor = &HFF0000
- f.DrawMode = 10
- f.FillStyle = 0
-
- 'set the scalewidth equal to the
- 'upper limit of the items to count
- f.ScaleWidth = upperLimit
-
- f.Cls
- f.Visible = True
-
- 'set a form-level variable for the flood message
- 'to avoid the need for continually passing a string
- fmsg = floodMessage
-
- End Sub
- Sub FloodHide()
-
- 'hide the flood panel
- f.Visible = False
- f.Cls
-
- 'free the memory used by the f object
- Set f = Nothing
-
- End Sub
- Public Sub FloodUpdateText(progress)
-
- Dim r As Long
- Dim stNew As String
-
- 'make sure that the flood display hasn't already hit 100%
-
- If progress <= f.ScaleWidth Then
-
- 'trap in case the code below attempts to set
- 'the scalewidth greater than the max allowable
- If progress > f.ScaleWidth Then progress = f.ScaleWidth
-
- 'clear the flood
- f.Cls
-
- 'calculate the string's X & Y coordinates for left-justified
- 'and vertically centered text and print the string
- f.CurrentX = 2
- f.CurrentY = (f.ScaleHeight - f.TextHeight(fmsg)) \ 2
-
- stNew = ""
- stNew = fmsg & "..." & Format$(CLng((progress / f.ScaleWidth) * 100)) + "%"
- f.Print stNew
-
- DoEvents
-
- 'fill in the flood bar to the new progress length
- f.Line (0, 0)-(progress, f.ScaleHeight), f.ForeColor, BF
-
- 'f.Refresh
- 'REQUIRED: allow the flood to complete drawing
- DoEvents
-
- End If
-
- End Sub
-
-