home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 26 / CD_ASCQ_26_1295.iso / vrac / pzdemo.zip / STATUS.FRM < prev   
Text File  |  1995-07-24  |  3KB  |  85 lines

  1. VERSION 2.00
  2. Begin Form StatusDlg 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "StatusDlg"
  6.    ClientHeight    =   855
  7.    ClientLeft      =   3090
  8.    ClientTop       =   5655
  9.    ClientWidth     =   6225
  10.    ClipControls    =   0   'False
  11.    ControlBox      =   0   'False
  12.    Height          =   1260
  13.    Left            =   3030
  14.    LinkTopic       =   " "
  15.    MaxButton       =   0   'False
  16.    MinButton       =   0   'False
  17.    ScaleHeight     =   855
  18.    ScaleWidth      =   6225
  19.    Top             =   5310
  20.    Width           =   6345
  21.    Begin PZPanel PZPanel1 
  22.       BevelInner      =   1  'Inset
  23.       Height          =   315
  24.       Left            =   150
  25.       TabIndex        =   3
  26.       Top             =   240
  27.       Width           =   5940
  28.       Begin PictureBox Gauge 
  29.          AutoRedraw      =   -1  'True
  30.          BackColor       =   &H00FFFFFF&
  31.          ForeColor       =   &H00000000&
  32.          Height          =   255
  33.          Left            =   30
  34.          ScaleHeight     =   225
  35.          ScaleWidth      =   5865
  36.          TabIndex        =   4
  37.          Top             =   30
  38.          Width           =   5895
  39.       End
  40.    End
  41.    Begin PictureBox InvisGauge 
  42.       AutoRedraw      =   -1  'True
  43.       BackColor       =   &H00FF0000&
  44.       ForeColor       =   &H00FFFFFF&
  45.       Height          =   255
  46.       Left            =   150
  47.       ScaleHeight     =   225
  48.       ScaleWidth      =   5865
  49.       TabIndex        =   2
  50.       Top             =   1380
  51.       Visible         =   0   'False
  52.       Width           =   5895
  53.    End
  54. End
  55. Option Explicit
  56.  
  57. 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
  58.  
  59. Const SRCCOPY = &HCC0020
  60.  
  61. Sub UpdateStatus (pct As Integer)
  62.     Dim percent      As String
  63.     Dim OldScaleMode As Integer
  64.     Dim wRtn         As Integer
  65.     
  66.     percent = Format$(CLng(pct)) & "%"
  67.     StatusDlg.Gauge.Cls
  68.     StatusDlg.InvisGauge.Cls
  69.     '
  70.     ' Place percent complete string in center of both labels
  71.     '
  72.     StatusDlg.Gauge.CurrentX = (StatusDlg.Gauge.Width - StatusDlg.Gauge.TextWidth(percent)) / 2
  73.     StatusDlg.InvisGauge.CurrentX = StatusDlg.Gauge.CurrentX
  74.     StatusDlg.Gauge.CurrentY = (StatusDlg.Gauge.Height - StatusDlg.Gauge.TextHeight(percent)) / 2
  75.     StatusDlg.InvisGauge.CurrentY = StatusDlg.Gauge.CurrentY
  76.     StatusDlg.Gauge.Print percent
  77.     StatusDlg.InvisGauge.Print percent
  78.     OldScaleMode = StatusDlg.Gauge.Parent.ScaleMode
  79.     StatusDlg.Gauge.Parent.ScaleMode = 3
  80.     wRtn = BitBlt(StatusDlg.Gauge.hDC, 0, 0, StatusDlg.InvisGauge.Width * pct \ 100, StatusDlg.InvisGauge.Height, StatusDlg.InvisGauge.hDC, 0, 0, SRCCOPY)
  81.     StatusDlg.Gauge.Parent.ScaleMode = OldScaleMode
  82.     StatusDlg.Gauge.Refresh
  83. End Sub
  84.  
  85.