home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / bp_1_94 / bonus / stbar / child.frm next >
Text File  |  1993-05-24  |  2KB  |  93 lines

  1. VERSION 2.00
  2. Begin Form fmChild 
  3.    BackColor       =   &H8000000F&
  4.    Caption         =   "StBar Example Child Form"
  5.    Height          =   3045
  6.    Left            =   1050
  7.    LinkMode        =   1  'Source
  8.    LinkTopic       =   "Form1"
  9.    MDIChild        =   -1  'True
  10.    ScaleHeight     =   2640
  11.    ScaleWidth      =   5910
  12.    Top             =   1125
  13.    Width           =   6030
  14.    Begin Timer Timer1 
  15.       Enabled         =   0   'False
  16.       Interval        =   100
  17.       Left            =   0
  18.       Top             =   0
  19.    End
  20.    Begin CommandButton Command4 
  21.       Caption         =   "Show &progress bar"
  22.       Height          =   495
  23.       Left            =   600
  24.       TabIndex        =   3
  25.       Top             =   1920
  26.       Width           =   4695
  27.    End
  28.    Begin CommandButton Command3 
  29.       Caption         =   "toggle &visible property"
  30.       Height          =   495
  31.       Left            =   600
  32.       TabIndex        =   2
  33.       Top             =   1320
  34.       Width           =   4695
  35.    End
  36.    Begin CommandButton Command2 
  37.       Caption         =   "show &second message"
  38.       Height          =   495
  39.       Left            =   600
  40.       TabIndex        =   1
  41.       Top             =   720
  42.       Width           =   4695
  43.    End
  44.    Begin CommandButton Command1 
  45.       Caption         =   "show &first message"
  46.       Height          =   495
  47.       Left            =   600
  48.       TabIndex        =   0
  49.       Top             =   120
  50.       Width           =   4695
  51.    End
  52. End
  53. Option Explicit
  54.  
  55. Dim iProgress As Integer
  56.  
  57. Declare Sub StBarVisible Lib "STBAR.VBX" (ByVal hWnd As Integer, ByVal iVisible As Integer)
  58.  
  59. Sub Command1_Click ()
  60.     fmMain.sbMain.Caption = "first message"
  61. End Sub
  62.  
  63. Sub Command2_Click ()
  64.     fmMain.sbMain.Caption = "second message"
  65. End Sub
  66.  
  67. Sub Command3_Click ()
  68.     Dim iVisible As Integer
  69.     iVisible = Not fmMain.sbMain.Visible
  70.     StBarVisible fmMain.hWnd, iVisible
  71.     fmMain.piStBar.Visible = iVisible
  72. End Sub
  73.  
  74. Sub Command4_Click ()
  75.     iProgress = 0
  76.     Timer1.Enabled = True
  77. End Sub
  78.  
  79. Sub Timer1_Timer ()
  80.     Dim sCaption As String
  81.  
  82.     If iProgress >= 100 Then
  83.         Timer1.Enabled = False
  84.         sCaption = ""
  85.     Else
  86.         sCaption = "%" + Format$(iProgress) + "%Work in progress, " + Format$(iProgress) + "% done."
  87.         iProgress = iProgress + 2
  88.     End If
  89.  
  90.     fmMain.sbMain.Caption = sCaption
  91. End Sub
  92.  
  93.