By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,060 Members | 1,878 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,060 IT Pros & Developers. It's quick & easy.

How to show a ContextMenuStrip without displaying at taskbar?

P: n/a
I am writing a NotifyIcon app.
I want to use Left mouse click to pop up a ContextMenuStrip.

Currently, I use
ContextMenuScrip.Show(x,y) to display it.
But it always show a windows at taskbar like I popup a window form.

Did I use the wrong method?

Se*********@hotmail.com

27th,Dec
Dec 27 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Anyone notice my problem?
Any help is appreciated.

"Seraph Jiang" <Se*********@gmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I am writing a NotifyIcon app.
I want to use Left mouse click to pop up a ContextMenuStrip.

Currently, I use
ContextMenuScrip.Show(x,y) to display it.
But it always show a windows at taskbar like I popup a window form.

Did I use the wrong method?

Se*********@hotmail.com

27th,Dec

Dec 28 '05 #2

P: n/a
I had the same problem. I could not find a way to achieve this without
using Reflection. This won't be officially supported, since it uses a
private method on the NotifyIcon class, but here's what I did (using an
anonymous method):

niMain.MouseClick += delegate( object sender, MouseEventArgs e )
{
if ( e.Button != MouseButtons.Right )
{
niMain.GetType().InvokeMember(
"ShowContextMenu",

BindingFlags.InvokeMethod|BindingFlags.Instance|Bi ndingFlags.NonPublic,
null,
niMain,
null
);
}
};

Jan 5 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.