.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

notifyicon in c#

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :Windows Application
I kept the notifyicon in my control.when i start my application,it will appear in notification area.suppose i force to kill the application it will not disappear in that area.when i move the cursor position in that area only it will disappear.....how to avoid this....

View Complete Post

More Related Resource Links

Open ContextMenuStrip on left mouse click on NotifyIcon

Hi,I was working with an application and faced this problem, I have this code :public partial class Form2 : Form    {        public Form2()        {            InitializeComponent();        }        private void notifyIcon1_MouseClick(object sender, MouseEventArgs e)        {            if (e.Button == MouseButtons.Left)            {                contextMenuStrip1.Show(this, Control.MousePosition); // Or any other overload            }        }        private void Form2_Load(object sender, EventArgs e)        {            notifyIcon1.Icon = Icon;        }    }Here, in design mode, i have set contextMenuStrip1 as notifyIcon1's ContextMenuStrip. When I right click on notifyIcon1, it opens the context menu and when I click somewhere else, it closes. But with my code opens the contextmenu on left click and when I open context menu that way, it shows in taskbar and doesn't close when I click some where else.In short, I want to open contextmenustrip when user left clicks and right clicks on the notifyicon and it works well with right click by default but not with left click. And I want to avoid using SendMessage to send left click message.Is there any way I can work this out?

notifyIcon works with windows forms but not services....

If I create a NotifyIcon in a designer of a windows application and assign an icon to it - it works just fine.   It shows up in the tray, and behaves just as it should.

However, if I create it in a windows service, then install that service and run it - the icon doesn't show up in the tray.  I have no idea why.

Any suggestions?

oh also, I couldn't find a better forum to post this in, so hope this works.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend