473,503 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding Menuitems to Contextmenu doesn't work

Below is s snippet of my code, which should add menuitems as a submenu
of an item in a contextmenu. But only the first time the contextmenu
opens the entrys are set correctly. I just don't know why or how to
solve this problem...

private void contextMenu1_Popup(object sender, System.EventArgs e)
{
contextMenu1.MenuItems[0].MenuItems.Clear();
Process[] myProcesses = Process.GetProcessesByName("IEXPLORE");
if (myProcesses.Length > 0)
{
contextMenu1.MenuItems[0].Enabled = true;
foreach (Process process in myProcesses)
contextMenu1.MenuItems[0].MenuItems.Add("(" +
process.Id.ToString() + ") : " + process.MainWindowTitle.ToString(),
new EventHandler(processmenu_clicked));
}
else
contextMenu1.MenuItems[0].Enabled = false;
}
Nov 15 '05 #1
0 1153

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1831
by: Jan Stenberg | last post by:
I have a situation where I open a database connection in main script. Then I start a transaction, have some queries, include an another php file within some queries and then commiting queries in...
15
1559
by: AV | last post by:
Hallo any idea why the following code doesn't work? ////////////////////////////////// function myfunc(){ with(this){ prop="hallo world"; } }
6
1430
by: Larry Woods | last post by:
I am trying to name my submenus (MainMenu control) and they show up in the menu dropdown...like they are O.K., but when I check my controls the names are still "MenuItemX". OTOH, the top-level...
4
1128
by: Deborah | last post by:
Thanks to all who've replied. I understand about the small font, and will work on that next, after I solve this problem. www.simi-therapy.com/badstylesheet is the page...
185
17221
by: Martin Jørgensen | last post by:
Hi, Consider: ------------ char stringinput ..bla. bla. bla. do {
6
1801
by: emmajoh | last post by:
Hi I'm trying to disable IE contextmenu (on a right click) as I want to create my own. The problem is that since I've installed the latest version of the google desktop, the script doesn't...
4
3047
by: Rob | last post by:
Hi, Is there anything wrong with this code or does new Option just not work very well. I have a select box on my form: <select name="FirstLine" size="5" style="width:122px;"> </select> and I...
4
6137
by: Neil | last post by:
I just noticed that control tips aren't working in any of my databases. I recently installed Access 2003, and created a database in it, and noticed that control tips weren't working in my controls....
0
1242
by: zhengmao | last post by:
I have one store procedure, which works fine in SQL Analyzer when I test it out, but doesn't work when I call it in web application. the problem is it doesn't insert last line, and the problem is...
0
7198
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
7072
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
7271
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,...
0
7319
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6979
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5570
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.