home *** CD-ROM | disk | FTP | other *** search
/ The Best of Windows 95.com 1996 September / WIN95_09964.iso / program / TrayIcon.zip / frmTrayIcon.frm (.txt) next >
Visual Basic Form  |  1996-02-22  |  6KB  |  204 lines

  1. VERSION 4.00
  2. Begin VB.Form frmTrayIcon 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "TrayIcon OCX Sample"
  5.    ClientHeight    =   1920
  6.    ClientLeft      =   1140
  7.    ClientTop       =   1515
  8.    ClientWidth     =   6540
  9.    Height          =   2325
  10.    Icon            =   "frmTrayIcon.frx":0000
  11.    Left            =   1080
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    ScaleHeight     =   1920
  15.    ScaleWidth      =   6540
  16.    ShowInTaskbar   =   0   'False
  17.    Top             =   1170
  18.    Width           =   6660
  19.    Begin VB.TextBox txtToolTip 
  20.       Height          =   285
  21.       Left            =   840
  22.       TabIndex        =   11
  23.       Top             =   1560
  24.       Width           =   2835
  25.    End
  26.    Begin VB.CommandButton btnUpdateIcon 
  27.       Caption         =   "UpdateIcon"
  28.       Height          =   375
  29.       Left            =   5220
  30.       TabIndex        =   9
  31.       Top             =   420
  32.       Width           =   1215
  33.    End
  34.    Begin VB.CommandButton btnHideIcon 
  35.       Caption         =   "HideIcon"
  36.       Height          =   375
  37.       Left            =   3840
  38.       TabIndex        =   8
  39.       Top             =   420
  40.       Width           =   1275
  41.    End
  42.    Begin VB.CommandButton btnShowIcon 
  43.       Caption         =   "ShowIcon"
  44.       Height          =   375
  45.       Left            =   2460
  46.       TabIndex        =   7
  47.       Top             =   420
  48.       Width           =   1275
  49.    End
  50.    Begin VB.TextBox txtEvent 
  51.       Height          =   315
  52.       Left            =   2460
  53.       TabIndex        =   5
  54.       Top             =   1140
  55.       Width           =   3975
  56.    End
  57.    Begin VB.CheckBox chkMouseMoveEvents 
  58.       Caption         =   "MouseMoveEvents"
  59.       Height          =   255
  60.       Left            =   120
  61.       TabIndex        =   3
  62.       Top             =   1200
  63.       Width           =   2115
  64.    End
  65.    Begin VB.CheckBox chkAutoUpdate 
  66.       Caption         =   "AutoUpdate"
  67.       Height          =   255
  68.       Left            =   120
  69.       TabIndex        =   2
  70.       Top             =   900
  71.       Width           =   2115
  72.    End
  73.    Begin VB.CheckBox chkVisible 
  74.       Caption         =   "Visible"
  75.       Height          =   255
  76.       Left            =   120
  77.       TabIndex        =   1
  78.       Top             =   600
  79.       Width           =   2115
  80.    End
  81.    Begin TRAYICONLibCtl.TrayIcon TrayIcon1 
  82.       Left            =   6000
  83.       Top             =   1500
  84.       _Version        =   65536
  85.       _ExtentX        =   741
  86.       _ExtentY        =   741
  87.       _StockProps     =   0
  88.       ToolTip         =   "TrayIcon OCX Sample"
  89.       Icon            =   "frmTrayIcon.frx":0442
  90.    End
  91.    Begin VB.Label Label4 
  92.       Caption         =   "ToolTip"
  93.       Height          =   255
  94.       Left            =   120
  95.       TabIndex        =   10
  96.       Top             =   1560
  97.       Width           =   615
  98.    End
  99.    Begin VB.Label Label3 
  100.       Caption         =   "Methods"
  101.       Height          =   195
  102.       Left            =   2520
  103.       TabIndex        =   6
  104.       Top             =   120
  105.       Width           =   2055
  106.    End
  107.    Begin VB.Label Label2 
  108.       Caption         =   "Events"
  109.       Height          =   195
  110.       Left            =   2460
  111.       TabIndex        =   4
  112.       Top             =   900
  113.       Width           =   2115
  114.    End
  115.    Begin VB.Label Label1 
  116.       Caption         =   "Properties"
  117.       Height          =   255
  118.       Left            =   120
  119.       TabIndex        =   0
  120.       Top             =   120
  121.       Width           =   2115
  122.    End
  123. Attribute VB_Name = "frmTrayIcon"
  124. Attribute VB_Creatable = False
  125. Attribute VB_Exposed = False
  126. Option Explicit
  127. Private Sub btnHideIcon_Click()
  128.     Dim success As Boolean
  129.     success = TrayIcon1.HideIcon
  130.     If TrayIcon1.Visible Then
  131.         chkVisible = 1
  132.     Else
  133.         chkVisible = 0
  134.     End If
  135. End Sub
  136. Private Sub btnShowIcon_Click()
  137.     Dim success As Boolean
  138.     success = TrayIcon1.ShowIcon
  139.     If TrayIcon1.Visible Then
  140.         chkVisible = 1
  141.     Else
  142.         chkVisible = 0
  143.     End If
  144. End Sub
  145. Private Sub btnUpdateIcon_Click()
  146.     Dim success As Boolean
  147.     success = TrayIcon1.UpdateIcon
  148.     If TrayIcon1.Visible Then
  149.         chkVisible = 1
  150.     Else
  151.         chkVisible = 0
  152.     End If
  153. End Sub
  154. Private Sub chkAutoUpdate_Click()
  155.     If chkAutoUpdate = 1 Then
  156.         TrayIcon1.AutoUpdate = True
  157.     Else
  158.         TrayIcon1.AutoUpdate = False
  159.     End If
  160. End Sub
  161. Private Sub chkMouseMoveEvents_Click()
  162.     If chkMouseMoveEvents = 1 Then
  163.         TrayIcon1.MouseMoveEvents = True
  164.     Else
  165.         TrayIcon1.MouseMoveEvents = False
  166.     End If
  167. End Sub
  168. Private Sub Form_Load()
  169.     If TrayIcon1.Visible Then
  170.         chkVisible = 1
  171.     Else
  172.         chkVisible = 0
  173.     End If
  174.     If TrayIcon1.AutoUpdate Then
  175.         chkAutoUpdate = 1
  176.     Else
  177.         chkAutoUpdate = 0
  178.     End If
  179.     If TrayIcon1.MouseMoveEvents Then
  180.         chkMouseMoveEvents = 1
  181.     Else
  182.         chkMouseMoveEvents = 0
  183.     End If
  184.     txtToolTip = TrayIcon1.ToolTip
  185. End Sub
  186. Private Sub TrayIcon1_LeftClick(ByVal x As Single, ByVal y As Single)
  187.     txtEvent = "LeftClick at (x,y) = (" & x & ", " & y & ")"
  188. End Sub
  189. Private Sub TrayIcon1_LeftDblClick(ByVal x As Single, ByVal y As Single)
  190.     txtEvent = "LeftDblClick at (x,y) = (" & x & ", " & y & ")"
  191. End Sub
  192. Private Sub TrayIcon1_MouseMoveOver(ByVal x As Single, ByVal y As Single)
  193.     txtEvent = "MouseMoveOver at (x,y) = (" & x & ", " & y & ")"
  194. End Sub
  195. Private Sub TrayIcon1_RightClick(ByVal x As Single, ByVal y As Single)
  196.     txtEvent = "RightClick at (x,y) = (" & x & ", " & y & ")"
  197. End Sub
  198. Private Sub TrayIcon1_RightDblClick(ByVal x As Single, ByVal y As Single)
  199.     txtEvent = "RightDblClick at (x,y) = (" & x & ", " & y & ")"
  200. End Sub
  201. Private Sub txtToolTip_Change()
  202.     TrayIcon1.ToolTip = txtToolTip
  203. End Sub
  204.