.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to remove a duplicate Mouse right click Event

7 REPLIES 7
Reply
Message 1 of 8
AubelecBE
1064 Views, 7 Replies

How to remove a duplicate Mouse right click Event

Hi all.

i have the right click on autocad for repeat the last command.

 

when i launch my prog.   --> the prog show a form with a datagridview. I have added a contextMenuStrip in this datagridview.

 

SO when i launch the prog with the right click (repeat last command) the form show and the contextmenustrip too. (if the mouse is on the datagrid.)

 

 

How i can cancel or purge the event mouse right click ?

 

I am a noob on the event with vb.net.

 

thanks.

 

 

7 REPLIES 7
Message 2 of 8
chiefbraincloud
in reply to: AubelecBE

For some unknown reason I thought your native language was German, but by looking at your profile, It seems your native language is French.  My French is much better than my German (but not great).

 

In any case, I have just recently (just today, or yesterday, depending on the time zone) started to add a ContextMenuStrip to one of my DataGridView controls, and I have not yet arrived at the point where I could see the behavior you suggest, but I also don't understand your question completely.

 

Maybe it might help if you phrased your question in your own native language, and then put that through a translator (I know google has a translator, and I am almost sure Microsoft has one under the Bing framework)

 

Either way, I'll bet I post something on this issue tomorrow or Wednesday, after I finish my current effort, which is to add Paste operations to the DataGridview control already in use (And of course I decided that Ctrl-V needs to be handled, but also Right-Click/Paste).

Dave O.                                                                  Sig-Logos32.png
Message 3 of 8
DesignProQuig
in reply to: AubelecBE

A possibility If something is firing twice using a form control, double click the control on the form and on the right hand side check the "Handles" there may be more than one.  I have had to delete the offending ones in the past so there is only on event:

 

eg:

 

Change "Handles Button1.Click, Button1Click"

to             "Handles Button1.Click"

http://www.designprosoftware.co.uk/
Message 4 of 8
AubelecBE
in reply to: DesignProQuig

hi. i have looked for this but i don't use this.

 

anyone have a trick for remove all event mouse click right or left before launch a dialog form  ?

 

 

Message 5 of 8
chiefbraincloud
in reply to: AubelecBE

I have been sidetracked, fixing a different problem, but I will be back on the issue of setting up Copy/Paste functionality with a DataGridView Control when I get back to work tomorrow.

 

I will let you know if I can reproduce your problem , and if I can find a way to fix it.

Dave O.                                                                  Sig-Logos32.png
Message 6 of 8
AubelecBE
in reply to: chiefbraincloud

thx
Message 7 of 8
chiefbraincloud
in reply to: AubelecBE

Sorry.  I forgot all about getting back to you, but unfortunately I finished my efforts enabling copy paste operations on a DataGridView with a ContextMenuStrip, but I have not been able to reproduce the problem you are seeing.

 

One reason might be that the command I am firing with a right click (repeat last command) first prompts the user to select a block before it displays the form.

 

Typing that just now did give me one idea.  Is your command method inside the form code?  If so, try moving the command method out of the form code and into a different class or module.  I'm afraid that's all I've got for suggestions.

Dave O.                                                                  Sig-Logos32.png
Message 8 of 8
AubelecBE
in reply to: chiefbraincloud

ths. but my command create a form. i display this form with .ShowDialog.

But if the mouse is on a datagridview associate with a contextStripMenu then the contextStrip show.

 

it is annoying for the user but not very painfull

I like to create a proper code for my user.

 

🙂

 

A+

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost