home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form TrayXSample
- BorderStyle = 1 'Fixed Single
- Caption = "Tray/X Control Sample"
- ClientHeight = 4110
- ClientLeft = 2130
- ClientTop = 2040
- ClientWidth = 7800
- Height = 4515
- Icon = "trayxsmp.frx":0000
- Left = 2070
- LinkTopic = "Form1"
- MaxButton = 0 'False
- ScaleHeight = 4110
- ScaleWidth = 7800
- Top = 1695
- Width = 7920
- Begin VB.ListBox lstLog
- Height = 2790
- Left = 240
- TabIndex = 3
- Top = 1080
- Width = 3495
- End
- Begin VB.TextBox txtTooltip
- Height = 285
- Left = 240
- TabIndex = 1
- Top = 480
- Width = 3495
- End
- Begin VB.CommandButton Command1
- Caption = "Hide Icon"
- Height = 495
- Left = 5520
- TabIndex = 0
- Top = 240
- Width = 1935
- End
- Begin VB.Label Label5
- AutoSize = -1 'True
- Caption = $"trayxsmp.frx":030A
- Height = 1365
- Left = 3960
- TabIndex = 7
- Top = 2505
- Width = 3495
- WordWrap = -1 'True
- End
- Begin VB.Label Label4
- AutoSize = -1 'True
- Caption = $"trayxsmp.frx":0432
- Height = 780
- Left = 3960
- TabIndex = 6
- Top = 1635
- Width = 3495
- WordWrap = -1 'True
- End
- Begin VB.Label Label3
- AutoSize = -1 'True
- Caption = "This sample shows how to use the Mabry Software Tray/X control. Tray/X is a light ActiveX control."
- Height = 585
- Left = 3960
- TabIndex = 5
- Top = 960
- Width = 3495
- WordWrap = -1 'True
- End
- Begin VB.Label Label2
- BackStyle = 0 'Transparent
- Caption = "Tray Icon Event Log:"
- Height = 255
- Left = 240
- TabIndex = 4
- Top = 840
- Width = 1815
- End
- Begin VB.Label Label1
- BackStyle = 0 'Transparent
- Caption = "Tool Tip Text:"
- Height = 255
- Left = 240
- TabIndex = 2
- Top = 240
- Width = 2775
- End
- Begin MTRAYXLibCtl.TrayX TrayX1
- Left = 4920
- Top = 240
- _ExtentX = 847
- _ExtentY = 847
- ToolTipText = "Mabry Toolman Logo"
- Visible = 0 'False
- Icon = "trayxsmp.frx":04F2
- End
- Attribute VB_Name = "TrayXSample"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub Command1_Click()
- ' Is the icon currently visible?
- If TrayX1.IconVisible Then
- ' If so, hide it and change the command
- ' button's text to reflect the current
- ' state.
- TrayX1.IconVisible = False
- Command1.Caption = "Show Icon"
- Else
- ' If not, show it and change the command
- ' button's text to reflect the current
- ' state.
- TrayX1.IconVisible = True
- Command1.Caption = "Hide Icon"
- End If
- End Sub
- Private Sub Form_Load()
- ' Set up controls and icon.
- txtTooltip.Text = TrayX1.ToolTipText
- TrayX1.IconVisible = True
- End Sub
- Private Sub Form_Resize()
- If Me.WindowState = vbMinimized Then
- Me.Visible = False
- Else
- Me.Visible = True
- End If
- End Sub
- Private Sub TrayX1_Click()
- ' Log this event
- lstLog.AddItem "Click"
- lstLog.ListIndex = lstLog.ListCount - 1
- End Sub
- Private Sub TrayX1_DblClick()
- If Me.WindowState = vbMinimized Then
- Me.WindowState = vbNormal
- Me.Visible = True
- End If
- ' Log this event
- lstLog.AddItem "DblClick"
- lstLog.ListIndex = lstLog.ListCount - 1
- End Sub
- Private Sub TrayX1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- ' Log this event
- lstLog.AddItem "MouseDown (" & X & "," & Y & ") button=" & Button & " shift=" & Shift
- lstLog.ListIndex = lstLog.ListCount - 1
- End Sub
- Private Sub TrayX1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- ' Log this event
- lstLog.AddItem "MouseMove (" & X & "," & Y & ") button=" & Button & " shift=" & Shift
- lstLog.ListIndex = lstLog.ListCount - 1
- End Sub
- Private Sub TrayX1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- ' Log this event
- lstLog.AddItem "MouseUp (" & X & "," & Y & ") button=" & Button & " shift=" & Shift
- lstLog.ListIndex = lstLog.ListCount - 1
- End Sub
- Private Sub TrayX1_RightClick()
- ' Log this event
- lstLog.AddItem "RightClick"
- lstLog.ListIndex = lstLog.ListCount - 1
- End Sub
- Private Sub txtTooltip_Change()
- ' When the user changes the text in this
- ' edit box, change the text displayed
- ' over the icon in the tray.
- TrayX1.ToolTipText = txtTooltip.Text
- End Sub
-