home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Power Pack / Visual_Basic4_Power_Pack.bin / vb4files / vbmaxlcd / lcdarray.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-11-20  |  9.2 KB  |  304 lines

  1. VERSION 4.00
  2. Begin VB.Form LCDArray 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "LCD Array - Time And Time Again"
  5.    ClientHeight    =   3885
  6.    ClientLeft      =   6570
  7.    ClientTop       =   4020
  8.    ClientWidth     =   5055
  9.    Height          =   4290
  10.    Icon            =   "LCDArray.frx":0000
  11.    Left            =   6510
  12.    LinkTopic       =   "Form1"
  13.    LockControls    =   -1  'True
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   3885
  17.    ScaleWidth      =   5055
  18.    ShowInTaskbar   =   0   'False
  19.    Top             =   3675
  20.    Width           =   5175
  21.    Begin VB.CommandButton cmdForeColor 
  22.       Caption         =   "ForeColor"
  23.       Height          =   315
  24.       Index           =   0
  25.       Left            =   1620
  26.       TabIndex        =   18
  27.       Top             =   840
  28.       Width           =   975
  29.    End
  30.    Begin VB.CommandButton cmdBackColor 
  31.       Caption         =   "BackColor"
  32.       Height          =   315
  33.       Index           =   0
  34.       Left            =   2640
  35.       TabIndex        =   17
  36.       Top             =   840
  37.       Width           =   975
  38.    End
  39.    Begin VB.PictureBox picLCD 
  40.       Height          =   330
  41.       Index           =   0
  42.       Left            =   1620
  43.       ScaleHeight     =   270
  44.       ScaleWidth      =   1935
  45.       TabIndex        =   16
  46.       Top             =   360
  47.       Width           =   1995
  48.    End
  49.    Begin VB.CommandButton cmdForeColor 
  50.       Caption         =   "ForeColor"
  51.       Height          =   315
  52.       Index           =   4
  53.       Left            =   2940
  54.       TabIndex        =   15
  55.       Top             =   3480
  56.       Width           =   975
  57.    End
  58.    Begin VB.CommandButton cmdBackColor 
  59.       Caption         =   "BackColor"
  60.       Height          =   315
  61.       Index           =   4
  62.       Left            =   3960
  63.       TabIndex        =   14
  64.       Top             =   3480
  65.       Width           =   975
  66.    End
  67.    Begin VB.CommandButton cmdForeColor 
  68.       Caption         =   "ForeColor"
  69.       Height          =   315
  70.       Index           =   3
  71.       Left            =   120
  72.       TabIndex        =   13
  73.       Top             =   3480
  74.       Width           =   975
  75.    End
  76.    Begin VB.CommandButton cmdBackColor 
  77.       Caption         =   "BackColor"
  78.       Height          =   315
  79.       Index           =   3
  80.       Left            =   1140
  81.       TabIndex        =   12
  82.       Top             =   3480
  83.       Width           =   975
  84.    End
  85.    Begin VB.CommandButton cmdForeColor 
  86.       Caption         =   "ForeColor"
  87.       Height          =   315
  88.       Index           =   2
  89.       Left            =   2940
  90.       TabIndex        =   11
  91.       Top             =   2160
  92.       Width           =   975
  93.    End
  94.    Begin VB.CommandButton cmdBackColor 
  95.       Caption         =   "BackColor"
  96.       Height          =   315
  97.       Index           =   2
  98.       Left            =   3960
  99.       TabIndex        =   10
  100.       Top             =   2160
  101.       Width           =   975
  102.    End
  103.    Begin VB.CommandButton cmdForeColor 
  104.       Caption         =   "ForeColor"
  105.       Height          =   315
  106.       Index           =   1
  107.       Left            =   120
  108.       TabIndex        =   9
  109.       Top             =   2160
  110.       Width           =   975
  111.    End
  112.    Begin VB.CommandButton cmdBackColor 
  113.       Caption         =   "BackColor"
  114.       Height          =   315
  115.       Index           =   1
  116.       Left            =   1140
  117.       TabIndex        =   8
  118.       Top             =   2160
  119.       Width           =   975
  120.    End
  121.    Begin VB.Timer Timer1 
  122.       Interval        =   500
  123.       Left            =   360
  124.       Top             =   300
  125.    End
  126.    Begin VB.PictureBox picLCD 
  127.       Height          =   330
  128.       Index           =   4
  129.       Left            =   2940
  130.       ScaleHeight     =   270
  131.       ScaleWidth      =   1935
  132.       TabIndex        =   3
  133.       Top             =   3000
  134.       Width           =   1995
  135.    End
  136.    Begin VB.PictureBox picLCD 
  137.       Height          =   330
  138.       Index           =   3
  139.       Left            =   120
  140.       ScaleHeight     =   270
  141.       ScaleWidth      =   1935
  142.       TabIndex        =   2
  143.       Top             =   3000
  144.       Width           =   1995
  145.    End
  146.    Begin VB.PictureBox picLCD 
  147.       Height          =   330
  148.       Index           =   2
  149.       Left            =   2940
  150.       ScaleHeight     =   270
  151.       ScaleWidth      =   1935
  152.       TabIndex        =   1
  153.       Top             =   1680
  154.       Width           =   1995
  155.    End
  156.    Begin VB.PictureBox picLCD 
  157.       Height          =   330
  158.       Index           =   1
  159.       Left            =   120
  160.       ScaleHeight     =   270
  161.       ScaleWidth      =   1935
  162.       TabIndex        =   0
  163.       Top             =   1680
  164.       Width           =   1995
  165.    End
  166.    Begin VB.Label Label1 
  167.       Alignment       =   2  'Center
  168.       Caption         =   "Washington DC"
  169.       BeginProperty Font 
  170.          name            =   "MS Sans Serif"
  171.          charset         =   0
  172.          weight          =   700
  173.          size            =   8.25
  174.          underline       =   0   'False
  175.          italic          =   0   'False
  176.          strikethrough   =   0   'False
  177.       EndProperty
  178.       Height          =   195
  179.       Left            =   1620
  180.       TabIndex        =   19
  181.       Top             =   120
  182.       Width           =   1995
  183.    End
  184.    Begin VB.Label Label5 
  185.       Alignment       =   2  'Center
  186.       Caption         =   "Mexico City"
  187.       BeginProperty Font 
  188.          name            =   "MS Sans Serif"
  189.          charset         =   0
  190.          weight          =   700
  191.          size            =   8.25
  192.          underline       =   0   'False
  193.          italic          =   0   'False
  194.          strikethrough   =   0   'False
  195.       EndProperty
  196.       ForeColor       =   &H00000000&
  197.       Height          =   195
  198.       Left            =   2940
  199.       TabIndex        =   7
  200.       Top             =   2760
  201.       Width           =   1995
  202.    End
  203.    Begin VB.Label Label4 
  204.       Alignment       =   2  'Center
  205.       Caption         =   "Tokyo"
  206.       BeginProperty Font 
  207.          name            =   "MS Sans Serif"
  208.          charset         =   0
  209.          weight          =   700
  210.          size            =   8.25
  211.          underline       =   0   'False
  212.          italic          =   0   'False
  213.          strikethrough   =   0   'False
  214.       EndProperty
  215.       Height          =   195
  216.       Left            =   120
  217.       TabIndex        =   6
  218.       Top             =   2760
  219.       Width           =   1995
  220.    End
  221.    Begin VB.Label Label3 
  222.       Alignment       =   2  'Center
  223.       Caption         =   "Madrid"
  224.       BeginProperty Font 
  225.          name            =   "MS Sans Serif"
  226.          charset         =   0
  227.          weight          =   700
  228.          size            =   8.25
  229.          underline       =   0   'False
  230.          italic          =   0   'False
  231.          strikethrough   =   0   'False
  232.       EndProperty
  233.       ForeColor       =   &H00000000&
  234.       Height          =   195
  235.       Left            =   2940
  236.       TabIndex        =   5
  237.       Top             =   1440
  238.       Width           =   1995
  239.    End
  240.    Begin VB.Label Label2 
  241.       Alignment       =   2  'Center
  242.       Caption         =   "London"
  243.       BeginProperty Font 
  244.          name            =   "MS Sans Serif"
  245.          charset         =   0
  246.          weight          =   700
  247.          size            =   8.25
  248.          underline       =   0   'False
  249.          italic          =   0   'False
  250.          strikethrough   =   0   'False
  251.       EndProperty
  252.       ForeColor       =   &H00000000&
  253.       Height          =   195
  254.       Left            =   120
  255.       TabIndex        =   4
  256.       Top             =   1440
  257.       Width           =   1995
  258.    End
  259. Attribute VB_Name = "LCDArray"
  260. Attribute VB_Creatable = False
  261. Attribute VB_Exposed = False
  262. Option Explicit
  263. Dim moLCD(4) As New clsLCD
  264. Private Sub Form_Load()
  265. Dim i As Integer
  266.     Screen.MousePointer = vbHourglass
  267.     For i = 0 To 4
  268.         With moLCD(i)
  269.             .Alignment = gnCENTER
  270.             .BackColor = &H8000&
  271.             .ForeColor = vbWhite
  272.              Set .Container = picLCD(i)
  273.        End With
  274.     Next i
  275.     moLCD(0).BlinkColon = True
  276.     Timer1_Timer
  277.     Screen.MousePointer = vbDefault
  278. End Sub
  279. Private Sub Form_Unload(Cancel As Integer)
  280. Dim i As Integer
  281.     For i = 0 To 4
  282.         Set moLCD(i) = Nothing
  283.     Next i
  284.     Set LCDArray = Nothing
  285. End Sub
  286. Private Static Sub Timer1_Timer()
  287. Dim vTime As Variant
  288.     vTime = Time()
  289.     moLCD(0).Caption = CalcTime(vTime, 0)
  290.     moLCD(1).Caption = CalcTime(vTime, 5)
  291.     moLCD(2).Caption = CalcTime(vTime, 6)
  292.     moLCD(3).Caption = CalcTime(vTime, 14)
  293.     moLCD(4).Caption = CalcTime(vTime, -1)
  294. End Sub
  295. Private Function CalcTime(rvTime As Variant, rnHoursDifference As Integer) As String
  296.     CalcTime = Format$(DateAdd("h", rnHoursDifference, rvTime), "h:mm A/P")
  297. End Function
  298. Private Sub cmdForeColor_Click(Index As Integer)
  299.     moLCD(Index).SelectForeColor
  300. End Sub
  301. Private Sub cmdBackColor_Click(Index As Integer)
  302.     moLCD(Index).SelectBackColor
  303. End Sub
  304.