Solved

How to catch right click on notify icon event?

Posted on 2004-10-11
4
457 Views
Last Modified: 2010-05-19
How do I  catch a  right click on notify icon event?
0
Comment
Question by:netslt
  • 2
4 Comments
 

Expert Comment

by:coletteck8
ID: 12280867
the Mouse_Down event catch all clicks and using the Button parameter you can check either left or right click.
0
 

Author Comment

by:netslt
ID: 12281236
Sorry but can you please be more precise and give me a sample?
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 125 total points
ID: 12281296
The two subs below will detect a right click.  The first on a Right Click Down and the second on a Right Click Up:

    Private Sub NotifyIcon1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseDown
        If e.Button = MouseButtons.Right Then
            MsgBox("Please don't do that...", MsgBoxStyle.Information, "Right Click Down")
        End If
    End Sub

    Private Sub NotifyIcon1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseUp
        If e.Button = MouseButtons.Right Then
            MsgBox("Please don't do that...", MsgBoxStyle.Information, "Right Click Up")
        End If
    End Sub
0
 

Author Comment

by:netslt
ID: 12281345
Works - thanks!
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question