home *** CD-ROM | disk | FTP | other *** search
/ Master 95 #1 / MASTER95_1.iso / microsof / vbasic4 / vb4-6.cab / button.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-07-26  |  2.9 KB  |  97 lines

  1. VERSION 4.00
  2. Begin VB.Form frmButton 
  3.    Caption         =   "Test Buttons"
  4.    ClientHeight    =   2790
  5.    ClientLeft      =   1890
  6.    ClientTop       =   2160
  7.    ClientWidth     =   4770
  8.    BeginProperty Font 
  9.       name            =   "MS Sans Serif"
  10.       charset         =   1
  11.       weight          =   700
  12.       size            =   8.25
  13.       underline       =   0   'False
  14.       italic          =   0   'False
  15.       strikethrough   =   0   'False
  16.    EndProperty
  17.    Height          =   3195
  18.    Left            =   1830
  19.    LinkTopic       =   "Form3"
  20.    ScaleHeight     =   2790
  21.    ScaleWidth      =   4770
  22.    Top             =   1815
  23.    Width           =   4890
  24.    Begin VB.CommandButton cmdClose 
  25.       Caption         =   "&Close"
  26.       Height          =   495
  27.       Left            =   3000
  28.       TabIndex        =   1
  29.       Top             =   1800
  30.       Width           =   1215
  31.    End
  32.    Begin VB.CommandButton cmdChange 
  33.       Caption         =   "Change &Signal"
  34.       Default         =   -1  'True
  35.       Height          =   495
  36.       Left            =   600
  37.       TabIndex        =   0
  38.       Top             =   1800
  39.       Width           =   1815
  40.    End
  41.    Begin VB.Image imgRed 
  42.       Height          =   480
  43.       Left            =   2160
  44.       Picture         =   "BUTTON.frx":0000
  45.       Top             =   720
  46.       Visible         =   0   'False
  47.       Width           =   480
  48.    End
  49.    Begin VB.Image imgYellow 
  50.       Height          =   480
  51.       Left            =   2160
  52.       Picture         =   "BUTTON.frx":030A
  53.       Top             =   720
  54.       Visible         =   0   'False
  55.       Width           =   480
  56.    End
  57.    Begin VB.Image imgGreen 
  58.       Height          =   480
  59.       Left            =   2160
  60.       Picture         =   "BUTTON.frx":0614
  61.       Top             =   720
  62.       Width           =   480
  63.    End
  64. Attribute VB_Name = "frmButton"
  65. Attribute VB_Creatable = False
  66. Attribute VB_Exposed = False
  67. Private Sub ChangeSignal()
  68.     ' Check to see what color the light is, and then change
  69.     ' it to the next color.  The order is green, yellow,
  70.     ' and then red.
  71.     If imgGreen.Visible = True Then
  72.         imgGreen.Visible = False
  73.         imgYellow.Visible = True
  74.     ElseIf imgYellow.Visible = True Then
  75.         imgYellow.Visible = False
  76.         imgRed.Visible = True
  77.     Else
  78.         imgRed.Visible = False
  79.         imgGreen.Visible = True
  80.     End If
  81. End Sub
  82. Private Sub cmdChange_Click()
  83.     ChangeSignal        ' Call the ChangeSignal procedure.
  84. End Sub
  85. Private Sub cmdClose_Click()
  86.    Unload Me            ' Unload this form.
  87. End Sub
  88. Private Sub imgGreen_Click()
  89.     ChangeSignal        ' Call the ChangeSignal procedure.
  90. End Sub
  91. Private Sub imgRed_Click()
  92.     ChangeSignal        ' Call the ChangeSignal procedure.
  93. End Sub
  94. Private Sub imgYellow_Click()
  95.     ChangeSignal        ' Call the ChangeSignal procedure.
  96. End Sub
  97.