REPOST : Context Menu

D

Dino M. Buljubasic

I have several context menus added to my form. The form is displaying items
in listviews connected to the context menus. When I click on an item in a
list view, a popup context menu shows allowing me to chese between editing
or deleting the item from the list view. That works fine.

However, in addition to calling the context menu on Click, I can call it
also by RightClick which causes application to either freeze, crash, call
Delete context menu two times, etc.

How can I solve this problem? Or how to limit pop up context menu to show
only when left clicked on an item.

Some people are recommending me to do MouseDown instead of Click but
MouseDown is not supported event for menu items of which my popup context
menu consists.

Any help will be appreciated,
Dino
 
A

Armin Zingler

Dino M. Buljubasic said:
I have several context menus added to my form. The form is
displaying items in listviews connected to the context menus. When I
click on an item in a list view, a popup context menu shows allowing
me to chese between editing or deleting the item from the list view.
That works fine.

However, in addition to calling the context menu on Click, I can call
it also by RightClick which causes application to either freeze,
crash, call Delete context menu two times, etc.

How can I solve this problem? Or how to limit pop up context menu to
show only when left clicked on an item.

Some people are recommending me to do MouseDown instead of Click
but MouseDown is not supported event for menu items of which my popup
context menu consists.

Usually the contextmenu is only shown when the right mouse button is
released. Did you try it?
 
D

Dino M. Buljubasic

Thanks Armin,

I fixed this one. The problem was that I was calling explicitly the context
menu on ListView.Click event. That is why I was getting it both ways, by
left and right clicking on my list view.

Regards,
Dino
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top