如何从contextMenuStrip中选择多个项目 [英] How to select multiple items from contextMenuStrip

查看:82
本文介绍了如何从contextMenuStrip中选择多个项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一个使用contextMenuStrip的C#winForm项目。我试图弄清楚如何禁用/覆盖默认行为,一次只允许一个toolStripMenuItem进行选择。我已经在这里工作了2天,我正在取得进展。



有谁知道任何链接或如何做到这一点?



在此先感谢,-DA

I'm working on a C# winForm project that use a contextMenuStrip. I'm trying to figure out how to disable/override default behavior of allowing only one toolStripMenuItem at a time for selection. I've been working at this for the last 2 days and I'm making 0 progress.

Does anyone know of any links or how to do this?

Thanks in advance, -DA

推荐答案

Mhm ...也许如果你试图赶上闭幕活动类似
Mhm... maybe if you try to catch the Closing Event with something like
private void _Context_Closing(object sender, ToolStripDropDownClosingEventArgs e) {
  if (e.CloseReason == ToolStripDropDownReason.ItemClicked) {
    e.Cancel = true;

    //some magic here...
  }
}


这篇关于如何从contextMenuStrip中选择多个项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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