.NET

Reply
Valued Mentor
AubelecBE
Posts: 373
Registered: ‎01-27-2010
Message 1 of 8 (388 Views)

How to remove a duplicate Mouse right click Event

388 Views, 7 Replies
04-30-2012 04:25 PM

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.

 

 

*Expert Elite*
chiefbraincloud
Posts: 752
Registered: ‎02-13-2008
Message 2 of 8 (377 Views)

Re: How to remove a duplicate Mouse right click Event

04-30-2012 10:01 PM 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
Active Contributor
DesignProQuig
Posts: 32
Registered: ‎03-02-2012
Message 3 of 8 (367 Views)

Re: How to remove a duplicate Mouse right click Event

05-01-2012 05:43 AM 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/
Valued Mentor
AubelecBE
Posts: 373
Registered: ‎01-27-2010
Message 4 of 8 (353 Views)

Re: How to remove a duplicate Mouse right click Event

05-01-2012 10:30 PM 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  ?

 

 

*Expert Elite*
chiefbraincloud
Posts: 752
Registered: ‎02-13-2008
Message 5 of 8 (349 Views)

Re: How to remove a duplicate Mouse right click Event

05-01-2012 11:19 PM 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
Valued Mentor
AubelecBE
Posts: 373
Registered: ‎01-27-2010
Message 6 of 8 (346 Views)

Re: How to remove a duplicate Mouse right click Event

05-02-2012 03:46 AM in reply to: chiefbraincloud
thx
*Expert Elite*
chiefbraincloud
Posts: 752
Registered: ‎02-13-2008
Message 7 of 8 (315 Views)

Re: How to remove a duplicate Mouse right click Event

05-24-2012 01:23 PM 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
Valued Mentor
AubelecBE
Posts: 373
Registered: ‎01-27-2010
Message 8 of 8 (294 Views)

Re: How to remove a duplicate Mouse right click Event

05-25-2012 03:34 PM 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.

 

:smileyhappy:

 

A+

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community