展现出的ContextMenuStrip没有它显示在任务栏 [英] Show a ContextMenuStrip without it showing in the taskbar

查看:232
本文介绍了展现出的ContextMenuStrip没有它显示在任务栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现,当我一个的ContextMenuStrip执行show()方法(右键菜单),如果位置之外,它属于形式的,它显示在任务栏也。

I have found that when I execute the show() method for a contextmenustrip (a right click menu), if the position is outside that of the form it belongs to, it shows up on the taskbar also.

我想创建的NotifyIcon的,当点击了右键菜单,但菜单悬停系统托盘上面,而不是形式的内部(如表格可以被最小化时,单击鼠标右键),它显示在任务酒吧一些奇怪的原因

I am trying to create a right click menu for when clicking on the notifyicon, but as the menu hovers above the system tray and not inside the form (as the form can be minimised when right clicking) it shows up on the task bar for some odd reason

下面是我的code目前:

Here is my code currently:

private: System::Void notifyIcon1_MouseClick(System::Object^  sender, System::Windows::Forms::MouseEventArgs^  e) {

if(e->Button == System::Windows::Forms::MouseButtons::Right) {

    	this->sysTrayMenu->Show(Cursor->Position);

    }
}

还有什么其他的选择,我需要设定,因此它不会出现在任务栏上的一个空白的过程。

What other options do I need to set so it doesn't show up a blank process on the task bar.

推荐答案

尝试分配你的菜单中的NotifyIcon的ContextMenuStrip属性,而不是显示它在鼠标点击的处理程序。

Try assigning your menu to the ContextMenuStrip property of NotifyIcon rather than showing it in the mouse click handler.

这篇关于展现出的ContextMenuStrip没有它显示在任务栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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