-
Oct 14th, 2021, 01:40 PM
#1
Thread Starter
Hyperactive Member
Right Click popup in DGV
I currently have written a routine that produces a popup contex menu when mouseButtons.Right is clicked. This works great unless the actual cell in the DGV is being edited. In which case It produces two popups. The one i created and the following:-
How do I disable this popup, (just allowing my defined popup) when the cursor is in the DGV area of the form
-
Oct 14th, 2021, 08:09 PM
#2
Re: Right Click popup in DGV
When you edit a cell in a DataGridView, a control is created and embedded in that cell. Most cells are DataGridViewTextBoxCells so the control is usually a TextBox. What you're seeing is the standard context menu for a TextBox and you would suppress it the same way you would for a standard TextBox. One option is to set the ShortcutsEnabled property of the editing control to False, but that would also disable keyboard operations like copy and paste. I think that the other option is to handle the MouseClick event, trap the right mouse button and set e.Handled to True, but I'd have to test that to confirm and I'm not inclined to do that myself.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|