home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / async / frmmain.frm (.txt) next >
Encoding:
Visual Basic Form  |  1998-09-12  |  3.3 KB  |  107 lines

  1. VERSION 5.00
  2. Begin VB.Form frmMain 
  3.    Caption         =   "Asynchronous Execution Example"
  4.    ClientHeight    =   3180
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   3720
  8.    Icon            =   "frmMain.frx":0000
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   3180
  11.    ScaleWidth      =   3720
  12.    StartUpPosition =   3  'Windows Default
  13.    Begin VB.CommandButton cmdCancel 
  14.       Caption         =   "Cancel"
  15.       Height          =   315
  16.       Left            =   2700
  17.       TabIndex        =   2
  18.       Top             =   2640
  19.       Width           =   735
  20.    End
  21.    Begin VB.CommandButton cmdStart 
  22.       Caption         =   "Start"
  23.       Height          =   315
  24.       Left            =   1860
  25.       TabIndex        =   0
  26.       Top             =   2640
  27.       Width           =   735
  28.    End
  29.    Begin VB.Label lblmisc 
  30.       Caption         =   "The status label below will indicate the current status of the async object (Started, Completed, Canceled)"
  31.       Height          =   615
  32.       Index           =   3
  33.       Left            =   120
  34.       TabIndex        =   6
  35.       Top             =   1920
  36.       Width           =   3465
  37.    End
  38.    Begin VB.Label lblmisc 
  39.       Caption         =   "You may cancel the asynchronous object from this application by clicking the cancel button."
  40.       Height          =   435
  41.       Index           =   2
  42.       Left            =   120
  43.       TabIndex        =   5
  44.       Top             =   1320
  45.       Width           =   3465
  46.    End
  47.    Begin VB.Label lblmisc 
  48.       Caption         =   "To test the application, click the start button, which starts the asynchronous object then returns control to this application."
  49.       Height          =   615
  50.       Index           =   0
  51.       Left            =   120
  52.       TabIndex        =   4
  53.       Top             =   540
  54.       Width           =   3450
  55.    End
  56.    Begin VB.Label lblmisc 
  57.       AutoSize        =   -1  'True
  58.       Caption         =   "This is your main application. "
  59.       Height          =   195
  60.       Index           =   1
  61.       Left            =   120
  62.       TabIndex        =   3
  63.       Top             =   180
  64.       Width           =   2070
  65.    End
  66.    Begin VB.Label lblStat 
  67.       BackStyle       =   0  'Transparent
  68.       Caption         =   "Status:"
  69.       Height          =   255
  70.       Left            =   120
  71.       TabIndex        =   1
  72.       Top             =   2700
  73.       Width           =   1635
  74.    End
  75. Attribute VB_Name = "frmMain"
  76. Attribute VB_GlobalNameSpace = False
  77. Attribute VB_Creatable = False
  78. Attribute VB_PredeclaredId = True
  79. Attribute VB_Exposed = False
  80. Option Explicit
  81. Dim tmpObj As TimeObj
  82. Attribute tmpObj.VB_VarHelpID = -1
  83. Public Sub CallBack()
  84.     If tmpObj.Canceled Then
  85.         lblStat.Caption = "Status: Canceled"
  86.     Else
  87.         lblStat.Caption = "Status: Complete"
  88.     End If
  89.     cmdStart.Enabled = True
  90.     cmdCancel.Enabled = False
  91. End Sub
  92. Private Sub cmdStart_Click()
  93.     lblStat.Caption = "Status: Started"
  94.     cmdStart.Enabled = False
  95.     cmdCancel.Enabled = True
  96.     tmpObj.StartApp Me
  97. End Sub
  98. Private Sub cmdCancel_Click()
  99.     tmpObj.StopApp
  100. End Sub
  101. Private Sub Form_Load()
  102.     Set tmpObj = New TimeObj
  103. End Sub
  104. Private Sub Form_Unload(Cancel As Integer)
  105.     Set tmpObj = Nothing
  106. End Sub
  107.