Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


Notifyicon to open a link after clicking on the icon


Notifyicon to open a link after clicking on the icon

Author
Message
john_zakaria
john_zakaria
Forum God
Forum God (4.1K reputation)Forum God (4.1K reputation)Forum God (4.1K reputation)Forum God (4.1K reputation)Forum God (4.1K reputation)Forum God (4.1K reputation)Forum God (4.1K reputation)Forum God (4.1K reputation)Forum God (4.1K reputation)

Group: Forum Members
Posts: 10, Visits: 17
hi everyone.. i made my windows service in C# and everything is running well except only one task..



i made a notifyicon1 in the taskbar so that the user can click on this notifycon1 and opens a links that it is retrieved from



database.



for example i am trying to open the link of google when the user clicks on the notifyicon1.



My problem is that the action of double click for the notify icon is not working neither for mouse move or double click action



my code is:

this.notifyIcon1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.john_move);

this.notifyIcon1.DoubleClick += new System.EventHandler(this.notifyIcon1_DoubleClick);



Note: i made 2 function one for the event double click and the other for mouse move coz i made first double click function



but it did not works for me.



private void notifyIcon1_DoubleClick(object Sender, EventArgs e)

{

try

{

File.WriteAllText(@"c:\\windows_service_files\\STErrors.txt", "notifyIcon1_DoubleClick " +



DateTime.Now.ToString());



//System.Diagnostics.Process.Start("http://www.google.com");



}

catch (Exception ex)

{

File.WriteAllText(@"c:\\windows_service_files\\STErrors.txt", "catch 1 "+DateTime.Now.ToString() +



ex.ToString());

}

}



private void john_move(object sender, System.Windows.Forms.MouseEventArgs e)

{

try

{

File.WriteAllText(@"c:\\windows_service_files\\STErrors.txt", "John move " + DateTime.Now.ToString());



System.Diagnostics.Process.Start("http://www.google.com");



}

catch (Exception ex)

{

File.WriteAllText(@"c:\\windows_service_files\\STErrors.txt", "catch 2 " + DateTime.Now.ToString() +



ex.ToString());

}

}





Please reply as soon as possible..



thanks and best regards for everyone
Edited
1/24/2011 by john_zakaria
TallOne
TallOne
Forum God
Forum God (50K reputation)Forum God (50K reputation)Forum God (50K reputation)Forum God (50K reputation)Forum God (50K reputation)Forum God (50K reputation)Forum God (50K reputation)Forum God (50K reputation)Forum God (50K reputation)

Group: Forum Members
Posts: 370, Visits: 212
What is the error you are getting?  Try changing the method scope from private to protected.

TallOne
john_zakaria
john_zakaria
Forum God
Forum God (4.1K reputation)Forum God (4.1K reputation)Forum God (4.1K reputation)Forum God (4.1K reputation)Forum God (4.1K reputation)Forum God (4.1K reputation)Forum God (4.1K reputation)Forum God (4.1K reputation)Forum God (4.1K reputation)

Group: Forum Members
Posts: 10, Visits: 17
TallOne (1/26/2011)
What is the error you are getting? Try changing the method scope from private to protected.




my problem is that neither the double click action nor the mouse move is functioning



also i have another problem.



i made the checkbox "allow the service to interact with desktop" checked using code. but it did not show the notify icon on desktop automatically after installing. i must go to services and check it again to run corrrectly
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search