Cocoa Dev
Cocoa Dev

Reputation: 9541

How to determine if a right click was performed on a Panel?

I have a Panel to play media. How can I determine if it was Right clicked? I want to bring up a ContextualMenu on the panel with (Pause, Play, Stop and Start Over)

Upvotes: 1

Views: 1142

Answers (2)

Yahia
Yahia

Reputation: 70369

just wire up your ContextMenu to the Panels ContextMenu property... another option is assign your handler to the MouseClick event of the Panel and check the event args for Button == MouseButtons.Right.

Upvotes: 4

NominSim
NominSim

Reputation: 8511

In visual studio on your form, add a contextmenustrip, and populate it with the values that you want. The panel has a property called contextmenustrip, all you need to do is set that to the one that you create and visual studio will do the rest for you.

Upvotes: 2

Related Questions