473,385 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to show a ContextMenuStrip without displaying at taskbar?

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
2 4527
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: D Witherspoon | last post by:
An application I've just finished developing is not showing up in the taskbar on startup until the application is clicked on. This makes it difficult as it is being launched as a No Touch...
1
by: Jake | last post by:
I'm having a problem with the ContextMenuStrip object when using it on a NotifyIcon while the taskbar is at the top of the screen. Problem: The context menu will draw above the top of the...
2
by: Flo | last post by:
Hello I want to be able to show/hide an application that is running. When i am getting the handles corresponding to an MS Office application (Excel for example), it appears that i get a handle...
5
by: spielmann | last post by:
Hi How can we hide and show the taskbar without dll on vb.net? How can we set the scrollbar size without dll on vb.net?
0
by: Viper | last post by:
I added a NotifyIcon to my project and a ContextMenuStrip so that when the taskbar icon is clicked a menu shows up. I added the ContextMenuStrip to the properties menu for the notifyicon. now...
1
by: =?Utf-8?B?QnJhZA==?= | last post by:
i have a menu system that is generated dynamically everything works good except for one minor astetic.... I click on a menu item that displays a ContextMenuStrip Popup Menu If an item on...
2
by: fniles | last post by:
In my VB6 program I have a Grid control, and when I right click on the grid, I will show a pop up menu. In VB.NET 2003 how can I show a pop up menu on a control ? This is the code from VB6...
9
by: =?Utf-8?B?Z2luYWNyZXNzZQ==?= | last post by:
Hi, I have a form (Form1) with a ContextMenuStrip (ContextMenuStrip1). If I pass Form1 to a Utility Sub with the following code: Public Sub Utility(theForm as Object) with theForm For Each...
2
by: eBob.com | last post by:
I've been working on an app which has an array of RichTextBoxes. And I have a context menu for the RTBs. The context menu has two levels; the first level has two items, "Load Sample Text File"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.