Print Page | Close Window

TrayIcon Icon property

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=14289
Printed Date: 28 April 2024 at 4:18pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: TrayIcon Icon property
Posted By: MattM
Subject: TrayIcon Icon property
Date Posted: 13 May 2009 at 12:17pm
I am using the TrayIcon control with a development tool which uses VBScript to manipulate the properties on the panel.

Refering to the documentation for the TrayIcon control I see that the Icon property expects a "Picture" object. The code sample only demonstrates using the VB form's icon, but I want to set the icon as part of the application's configuration.

I have tried using the VBScript LoadPicture function but get a type mismatch error.

TrayIcon1.Icon = LoadPicture("C:\256.ico")

I also tried using the image manager control without success.
Set MyPicture = CaptionImageManager1.Icons.GetImage(1,16)

What type is the Icon property and how can I populate it on the fly from a file on disk?


thanks,

matt



Replies:
Posted By: Aaron
Date Posted: 13 May 2009 at 4:06pm
Hi,
 
I tried the following options and they all work OK:
 
  1. TrayIcon1.Icon = LoadPicture(App.Path & "\Icons\Delete.ico")
  2. TrayIcon1.Icon = ImageManager.Icons.GetImage(1, 16).CreatePicture(xtpImageNormal)
  3. TrayIcon1.Icon = Me.Icon
  4. TrayIcon1.Icon = PictureBox.Picture
       
Hope this helps
 
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: MattM
Date Posted: 13 May 2009 at 5:01pm
Thanks Aaron,

I was not using the CreatePicture method.
This VBScript works fine.

TrayIcon1.Text = "Desyntime 2.0"
CaptionImageManager1.Icons.LoadIcon "C:\DesynTimeUpdated\DesynTime\256.ico", 1, 0
Set TrayIcon1.Icon = CaptionImageManager1.Icons.GetImage(1, 16).CreatePicture(xtpImageNormal)
TrayIcon1.MinimizeToTray AD.Field("WindowL<WindowHandle>")
TrayIcon1.ShowBalloonTip 2, "Desyntime is still running", "Click the icon to show the window again", 1

Matt



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net