在DataGridView中编辑单元格时,删除默认的上下文菜单 [英] Removing the default Context Menu when Editing a cell in DataGridView

查看:175
本文介绍了在DataGridView中编辑单元格时,删除默认的上下文菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的DataGridView中,当我编辑一个文本框单元格时,我右键单击我获取以下默认上下文菜单:

In my DataGridView, when I am editing a textbox cell, and I right click I get the following default Context Menu:

如何禁用这个功能,而不是拥有自己的上下文菜单弹出窗口?

How can I disable this "feature" and instead have my own context Menu popup?

推荐答案

这是你问什么?您可以使用链接找到类似的问题。

Is this is what you asking about? You can find the similar question using this link.

    private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
    {
        e.Control.ContextMenuStrip = myContextMenuStrip;
    }

这篇关于在DataGridView中编辑单元格时,删除默认的上下文菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆