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


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

system tray

Posted By: kamlesh     Posted Date: November 28, 2012    Points:5   Category :C#
i have one applicaiton which is having system tray ,
if user restart or sut down machine and on startup of system application icon present in system tray
how to do this.

and

for single instance i have used

bool createdNew = true;

var mutex = new Mutex(true, "Application.exe", out createdNew);
if (createdNew)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form());
}

when i minimise this application then it goes to system tray but problem is that when i double click on Application.exe it is not open

How to do please help me.

Responses
Author: Narayanan             
Posted Date: November 28, 2012     Points: 20   

Hi,
Please upload your Double Click Event Code.

Regards, Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
Author: Narayanan             
Posted Date: November 28, 2012     Points: 20   

Hi ,
try this Code.
  private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
Form1 frm = new Form1();
frm.Show();
}

private void Form1_Resize(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
notifyIcon1.Visible = true;
this.Hide();
notifyIcon1.ShowBalloonTip(10000, "<Your Application Name>", "Application has been moved to Tray. Double click the Icon to open the Application.", ToolTipIcon.Info);

}
}

private void Form1_Load(object sender, EventArgs e)
{
notifyIcon1.Visible = false;
}

private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
Application.Exit();
notifyIcon1.Visible = false;
}


Regards, Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

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