• 0

[VB.net] Systray


Question

Dear Programmers,

Yea, I am back.

How do I put a icon in systray next to the clock?

Like Msn Messenger, etc.

Thanks for any help you can give me. :D

Link to comment
Share on other sites

25 answers to this question

Recommended Posts

  • 0

Hi.

Jut add a notifyicon to your form, and set it's 'enabled' value to TRUE... Then dont forget to set an icon, which should be displayed in tasbar... :)

Link to comment
Share on other sites

  • 0
Hi.

Jut add a notifyicon to your form, and set it's 'enabled' value to TRUE... Then dont forget to set an icon, which should be displayed in tasbar... :)

Thanks I will try that. :D

Link to comment
Share on other sites

  • 0

Create a context menu on the form that contains the NotifyIcon and add that context menu to the NotifyIcon (it is one of the NotifyIcon's properties).

If the NotifyIcon is created by code, create the contextmenu by code, add the menuitems by code and "attach" it to the NotifyIcon.

Link to comment
Share on other sites

  • 0
Create a context menu on the form that contains the NotifyIcon and add that context menu to the NotifyIcon (it is one of the NotifyIcon's properties).

If the NotifyIcon is created by code, create the contextmenu by code, add the menuitems by code and "attach" it to the NotifyIcon.

Thanks, will do.

Is there a way to unload a hided form when the showing form is closed?

Thanks again :D

Link to comment
Share on other sites

  • 0

Okay heres the code:

Public Class Main
    Private Sub Main_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Me.Hide()
        Welcome.Show()
    End Sub
End Class

But it doesn't hide itseft.

Thanks for any help you can give me.

Link to comment
Share on other sites

  • 0

Okay heres the code:

Public Class Main
   Private Sub Main_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
       Me.Hide()
       Welcome.Show()
   End Sub
End Class

But main doesn't hide itseft.

Thanks for any help you can give me.

Link to comment
Share on other sites

  • 0

i think it wont hide it cos at the stage where that sub is called the graphical bit of the form dosent exist so theres nothing to hide...

the best way round this is to make something else the startup item then use it to load and show forms as desired.

or if its just to hide during welcom logo u could set its opacity to 0 then later put it back to 100... or get a function to increase it to 100 for a nice fade in effect.

Link to comment
Share on other sites

  • 0
i think it wont hide it cos at the stage where that sub is called the graphical bit of the form dosent exist so theres nothing to hide...

the best way round this is to make something else the startup item then use it to load and show forms as desired.

or if its just to hide during welcom logo u could set its opacity to 0 then later put it back to 100... or get a function to increase it to 100 for a nice fade in effect.

Ok, thanks I will do. :D

Link to comment
Share on other sites

  • 0
or if its just to hide during welcom logo u could set its opacity to 0 then later put it back to 100... or get a function to increase it to 100 for a nice fade in effect.

You'd probably wanna use the AnimateWindow API call for that effect...

Link to comment
Share on other sites

  • 0

Ok, I got that bit working.

I want my app to shutdown when the showing form is closed, but it only doesn't that for the Welcome form. :cry:

Thanks for any help you can give me. :D

Edited by gerry.74
Link to comment
Share on other sites

  • 0

And in response to gerry.74, it's always made me wondered how you would hide the form, because for some reason, even if you set the visible properties for the actual form to be false in the InitializeComponent() routine, it tends be overrided for some reason :s

Link to comment
Share on other sites

  • 0
Ok, I got that bit working.

I want my app to shutdown when the showing form is closed, but it only doesn't that for the Welcome form. :cry:

Thanks for any help you can give me. :D

If you want the entire application to close, use Application.Exit()

Link to comment
Share on other sites

  • 0

Thanks for that.

But there one more problem, I am trying to add a Reg code to work the program like photoshop tryout.

So far I got the form to enter the code, but how can you make it so when you enter the reg code it doesn't come up again?

Thanks for all the help, you are making this easy for me. :D

Link to comment
Share on other sites

  • 0
What program are you making gerry?

sorry about I am not telling anyone until it comes out, so no one can steal the idea :yes:

But you will be the first to know. :D

Link to comment
Share on other sites

  • 0
Thanks for that.

But there one more problem, I am trying to add a Reg code to work the program like photoshop tryout.

So far I got the form to enter the code, but how can you make it so when you enter the reg code it doesn't come up again?

Thanks for all the help, you are making this easy for me. :D

Anyone? :cry:

Link to comment
Share on other sites

  • 0

You mean like store the reg code? you can create a file and encrypt it to it, and make your App, to search for it on Load :cool: hope it helps

Link to comment
Share on other sites

  • 0
Anyone? :cry:

Well to make it not come up again, you'd probably just do some general checking, like does this file exist first, and if so, does the reg code correspond to what's required, if yes then continue loading and dont display a prompt, otherwise display a prompt, however some of those talented people who crack software, would by pass it anyway.

Link to comment
Share on other sites

  • 0
sorry about I am not telling anyone until it comes out, so no one can steal the idea :yes:

I will copy your program and give it away for free just for that :ninja:

lol just kiddin'! :laugh:

If you want a programmer who can help you, you can PM me! I have plenty of free time now :blink:

Link to comment
Share on other sites

  • 0
I will copy your program and give it away for free just for that :ninja:

lol just kiddin'! :laugh:

If you want a programmer who can help you, you can PM me! I have plenty of free time now :blink:

Thanks for that, I need all the help I can get.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.