home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / systra_1 / demo.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-03-02  |  4.6 KB  |  124 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Object = "{BF681672-D0F5-11D2-A445-E69F105FEC22}#1.0#0"; "SYSTRAY.OCX"
  4. Begin VB.Form frmDemo 
  5.    Caption         =   "SysTrayIt demo"
  6.    ClientHeight    =   1935
  7.    ClientLeft      =   60
  8.    ClientTop       =   345
  9.    ClientWidth     =   4485
  10.    Icon            =   "Demo.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   1935
  13.    ScaleWidth      =   4485
  14.    ShowInTaskbar   =   0   'False
  15.    StartUpPosition =   3  'Windows Default
  16.    Begin SysTray.SysTrayIt SysTrayIt 
  17.       Left            =   1560
  18.       Top             =   840
  19.       _ExtentX        =   979
  20.       _ExtentY        =   979
  21.       TipText         =   "Insert tip text here"
  22.       Icon            =   "Demo.frx":0442
  23.    End
  24.    Begin MSComctlLib.ImageList ilstIcons 
  25.       Left            =   840
  26.       Top             =   840
  27.       _ExtentX        =   1005
  28.       _ExtentY        =   1005
  29.       BackColor       =   -2147483643
  30.       ImageWidth      =   16
  31.       ImageHeight     =   16
  32.       MaskColor       =   12632256
  33.       _Version        =   393216
  34.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  35.          NumListImages   =   8
  36.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  37.             Picture         =   "Demo.frx":075C
  38.             Key             =   ""
  39.          EndProperty
  40.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  41.             Picture         =   "Demo.frx":0BB0
  42.             Key             =   ""
  43.          EndProperty
  44.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  45.             Picture         =   "Demo.frx":1004
  46.             Key             =   ""
  47.          EndProperty
  48.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  49.             Picture         =   "Demo.frx":1458
  50.             Key             =   ""
  51.          EndProperty
  52.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  53.             Picture         =   "Demo.frx":18AC
  54.             Key             =   ""
  55.          EndProperty
  56.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  57.             Picture         =   "Demo.frx":1D00
  58.             Key             =   ""
  59.          EndProperty
  60.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  61.             Picture         =   "Demo.frx":2154
  62.             Key             =   ""
  63.          EndProperty
  64.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  65.             Picture         =   "Demo.frx":25A8
  66.             Key             =   ""
  67.          EndProperty
  68.       EndProperty
  69.    End
  70.    Begin VB.Timer timTimer 
  71.       Enabled         =   0   'False
  72.       Interval        =   500
  73.       Left            =   270
  74.       Top             =   900
  75.    End
  76.    Begin VB.CommandButton cmdStart 
  77.       Caption         =   "Start demo"
  78.       Height          =   555
  79.       Left            =   90
  80.       TabIndex        =   0
  81.       Top             =   120
  82.       Width           =   1455
  83.    End
  84. Attribute VB_Name = "frmDemo"
  85. Attribute VB_GlobalNameSpace = False
  86. Attribute VB_Creatable = False
  87. Attribute VB_PredeclaredId = True
  88. Attribute VB_Exposed = False
  89. Private Sub cmdStart_Click()
  90.     SysTrayIt.Visible = Not SysTrayIt.Visible   'Shows/hides icon
  91.     timTimer.Enabled = SysTrayIt.Visible        'Starts to circle through images
  92.     cmdStart.Caption = IIf(SysTrayIt.Visible, "Stop demo", "Start demo")
  93. End Sub
  94. Private Sub Form_Load()
  95.     SysTrayIt.TipText = "Double click to stop me!"          'Default tip text
  96.     Set SysTrayIt.Icon = ilstIcons.ListImages(1).Picture    'Default picture (can be set at desing time too)
  97. End Sub
  98. Private Sub Form_Resize()
  99.     If Me.WindowState = vbMinimized Then
  100.         Set SysTrayIt.Icon = Me.Icon        'Sets icon to be shown
  101.         SysTrayIt.TipText = "Click me to resize me!" 'Sets tip text too
  102.         SysTrayIt.Visible = True            'Shows icon is systray
  103.     End If
  104. End Sub
  105. Private Sub Form_Terminate()
  106.     SysTrayIt.Visible = False               'Removes icon from systray
  107. End Sub
  108. Private Sub SysTrayIt_Click()
  109.     If Me.WindowState = vbMinimized Then
  110.         Me.WindowState = vbNormal
  111.         SysTrayIt.Visible = False           'Removes icon from systray
  112.         Me.SetFocus                         'Sets focus to form
  113.     End If
  114. End Sub
  115. Private Sub SysTrayIt_DblClick()
  116.     Call cmdStart_Click
  117. End Sub
  118. Private Sub timtimer_Timer()
  119.     'Circles through moon pictures in ilstIcons
  120.     Static Pic As Integer
  121.     Pic = (Pic Mod 8) + 1
  122.     Set SysTrayIt.Icon = ilstIcons.ListImages(Pic).Picture
  123. End Sub
  124.