|
-
Jun 22nd, 2010, 06:53 AM
#1
Thread Starter
Lively Member
SysTray Icon Help
is there any easy way to display animated gif in sys tray ?
or do i have to draw a simple picture/shape using GDI ?
-
Jun 22nd, 2010, 07:35 AM
#2
Re: SysTray Icon Help
As the name suggests, the NotifyIcon displays an Icon. If you want animation then you would intermittently change the Icon that is displayed. An animated GIF is simply a set of frames that get displayed on after the other. You can do that manually with multiple Icons. You could even derive your own custom NotifyIcon that allowed you to set a collection of icons and an interval and will then change its own Icon.
-
Jun 22nd, 2010, 07:39 AM
#3
Re: SysTray Icon Help
Apparently NotifyIcon is NotInheritable so you can forget that last suggestion.
-
Jun 22nd, 2010, 07:50 AM
#4
Thread Starter
Lively Member
Re: SysTray Icon Help
actually i was looking for something like this :
http://www.vbforums.com/showthread.p...ighlight=clock
but not that complicated, i dnt want to write huge code for GUI , whtever i can do in design mode is good.
-
Jun 22nd, 2010, 07:59 AM
#5
Re: SysTray Icon Help
And what does that project do? It creates a NotifyIcon and changes the Icon at run time, exactly as I said. How the icons are created is irrelevant to that fact. If you want to draw the Icons yourself then by all means do so.
-
Jun 22nd, 2010, 08:13 AM
#6
Thread Starter
Lively Member
Re: SysTray Icon Help
ok sorry for not explaining in details earlier...here it goes...
my little tool launches a url in new IE window when i click a button & waits till the page is loaded , so i simply wanna animate the systray icon i have added till the page is completely loaded.
According to u wht shud the eaisiest way to do that ? do i add series of icons in my resources & keeps them changing sequentially in a loop adding a delay, or is there a better way u can think of , like a said i do not want a too complicated code for this since i need to keep the file size in KB's & the tool is not that big in itself .
thx already ! =)
-
Jun 22nd, 2010, 08:24 AM
#7
Re: SysTray Icon Help
Add the Icons on the Resources page of the project properties. Add a Timer to your form with the appropriate Interval. Code like this:
vb.net Code:
Private icons As Icon() = {My.Resources.Icon1, My.Resources.Icon2, My.Resources.Icon3} Private iconIndex As Integer = 0 Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles Timer1.Tick Me.iconIndex = (Me.iconIndex + 1) Mod Me.icons.Length Me.NotifyIcon1.Icon = Me.icons(Me.iconIndex) End Sub
-
Jun 22nd, 2010, 08:29 AM
#8
Thread Starter
Lively Member
Re: SysTray Icon Help
awesome ... u saved by coding time for that jmcilhinney
thx a ton
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|