home *** CD-ROM | disk | FTP | other *** search
/ PC Press 1998 September / Sezamfile98_2.iso / VBasic / ZTRAY10.ZIP / Form1.frm next >
Text File  |  1997-08-04  |  6KB  |  223 lines

  1. VERSION 5.00
  2. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "comctl32.ocx"
  3. Object = "{CBB104A8-0C3C-11D1-BC39-004095912184}#2.0#0"; "ZTray.ocx"
  4. Object = "{FE0065C0-1B7B-11CF-9D53-00AA003C9CB6}#1.0#0"; "COMCT232.OCX"
  5. Begin VB.Form Form1 
  6.    Caption         =   "Sample"
  7.    ClientHeight    =   3150
  8.    ClientLeft      =   60
  9.    ClientTop       =   390
  10.    ClientWidth     =   4680
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   3150
  13.    ScaleWidth      =   4680
  14.    StartUpPosition =   3  'Windows Default
  15.    Begin VB.TextBox txtStatus 
  16.       Height          =   2295
  17.       Left            =   1920
  18.       MultiLine       =   -1  'True
  19.       TabIndex        =   6
  20.       Top             =   720
  21.       Width           =   2655
  22.    End
  23.    Begin VB.CheckBox chkShow 
  24.       Caption         =   "Show Tray Icon"
  25.       Height          =   375
  26.       Left            =   120
  27.       TabIndex        =   5
  28.       Top             =   1560
  29.       Value           =   1  'Checked
  30.       Width           =   1455
  31.    End
  32.    Begin ComCtl2.UpDown UpDown1 
  33.       Height          =   285
  34.       Left            =   496
  35.       TabIndex        =   4
  36.       Top             =   1080
  37.       Width           =   240
  38.       _ExtentX        =   423
  39.       _ExtentY        =   503
  40.       _Version        =   327680
  41.       Value           =   1
  42.       BuddyControl    =   "txtINum"
  43.       BuddyDispid     =   196612
  44.       OrigLeft        =   2280
  45.       OrigTop         =   1200
  46.       OrigRight       =   2520
  47.       OrigBottom      =   1935
  48.       Max             =   5
  49.       Min             =   1
  50.       SyncBuddy       =   -1  'True
  51.       Wrap            =   -1  'True
  52.       BuddyProperty   =   65547
  53.       Enabled         =   -1  'True
  54.    End
  55.    Begin VB.TextBox txtINum 
  56.       Height          =   285
  57.       Left            =   120
  58.       Locked          =   -1  'True
  59.       TabIndex        =   3
  60.       Text            =   "1"
  61.       Top             =   1080
  62.       Width           =   375
  63.    End
  64.    Begin VB.TextBox txtTip 
  65.       Height          =   285
  66.       Left            =   120
  67.       TabIndex        =   0
  68.       Text            =   "Text1"
  69.       Top             =   360
  70.       Width           =   4455
  71.    End
  72.    Begin myZTray.ZTray ZTray1 
  73.       Left            =   960
  74.       Top             =   2280
  75.       _ExtentX        =   953
  76.       _ExtentY        =   953
  77.       ImageList       =   "ImageList1"
  78.       TipText         =   "Testing the ZTray control!"
  79.       ImageNumber     =   1
  80.    End
  81.    Begin VB.Label Label2 
  82.       Caption         =   "ImageNumber:"
  83.       Height          =   255
  84.       Left            =   120
  85.       TabIndex        =   2
  86.       Top             =   840
  87.       Width           =   1215
  88.    End
  89.    Begin VB.Label Label1 
  90.       Caption         =   "TipText:"
  91.       Height          =   255
  92.       Left            =   120
  93.       TabIndex        =   1
  94.       Top             =   120
  95.       Width           =   1335
  96.    End
  97.    Begin ComctlLib.ImageList ImageList1 
  98.       Left            =   120
  99.       Top             =   2280
  100.       _ExtentX        =   1005
  101.       _ExtentY        =   1005
  102.       BackColor       =   -2147483643
  103.       ImageWidth      =   48
  104.       ImageHeight     =   48
  105.       MaskColor       =   12632256
  106.       _Version        =   327680
  107.       BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7} 
  108.          NumListImages   =   5
  109.          BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  110.             Picture         =   "Form1.frx":0000
  111.             Key             =   ""
  112.          EndProperty
  113.          BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  114.             Picture         =   "Form1.frx":031A
  115.             Key             =   ""
  116.          EndProperty
  117.          BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  118.             Picture         =   "Form1.frx":0634
  119.             Key             =   ""
  120.          EndProperty
  121.          BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  122.             Picture         =   "Form1.frx":094E
  123.             Key             =   ""
  124.          EndProperty
  125.          BeginProperty ListImage5 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  126.             Picture         =   "Form1.frx":0C68
  127.             Key             =   ""
  128.          EndProperty
  129.       EndProperty
  130.    End
  131. End
  132. Attribute VB_Name = "Form1"
  133. Attribute VB_GlobalNameSpace = False
  134. Attribute VB_Creatable = False
  135. Attribute VB_PredeclaredId = True
  136. Attribute VB_Exposed = False
  137. Option Explicit
  138.  
  139. Private Sub Check1_Click()
  140.  
  141.  
  142.  
  143. End Sub
  144.  
  145. Private Sub chkShow_Click()
  146.  
  147. 'All it takes to turn on/off the icon is to set
  148. ' Ztray.showintray to true/false.
  149.  
  150. If chkShow.Value = 1 Then
  151.     ZTray1.ShowInTray = True
  152. Else
  153.     ZTray1.ShowInTray = False
  154. End If
  155.  
  156. End Sub
  157.  
  158.  
  159. Private Sub Form_Load()
  160.  
  161. ' Turn the icon on (show it in the tray).
  162.  
  163. ZTray1.ShowInTray = True
  164.  
  165. ' Here I am setting the tip text box to the default
  166. ' text on the ZTray control.
  167.  
  168. txtTip.Text = ZTray1.TipText
  169.  
  170. End Sub
  171.  
  172.  
  173. Private Sub txtINum_Change()
  174.  
  175. ' This sets the ZTray ImageNumber to the next
  176. ' number in the list.  So you can see how easy
  177. ' it is to change the icon on the tray.
  178.  
  179. ZTray1.ImageNumber = Val(txtINum)
  180.  
  181. End Sub
  182.  
  183. Private Sub txtTip_Change()
  184.  
  185. ' This changes the TipText for the ZTray.
  186. ' This is the tip that appears when the
  187. ' mouse moves over the icon on the tray.
  188.  
  189. ZTray1.TipText = txtTip.Text
  190.  
  191. End Sub
  192.  
  193. Private Sub ZTray1_Click(button As Integer)
  194.  
  195. ' This prints the text of which button was clicked
  196. ' to give an example of how to respond to mouse clicks
  197. ' on the tray icon.
  198.  
  199. If button = 1 Then
  200.     txtStatus.Text = "Left Click" & vbCrLf & txtStatus.Text
  201. Else
  202.     txtStatus.Text = "Right Click" & vbCrLf & txtStatus.Text
  203. End If
  204.  
  205. End Sub
  206.  
  207.  
  208. Private Sub ZTray1_DblClick(button As Integer)
  209.  
  210. ' This prints the text of which button was double-clicked
  211. ' to give an example of how to respond to mouse clicks
  212. ' on the tray icon.
  213.  
  214. If button = 1 Then
  215.     txtStatus.Text = "Double Left Click" & vbCrLf & txtStatus.Text
  216. Else
  217.     txtStatus.Text = "Double Right Click" & vbCrLf & txtStatus.Text
  218. End If
  219.  
  220. End Sub
  221.  
  222.  
  223.