473,413 Members | 1,799 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,413 software developers and data experts.

Context menu in Combo Control

I've created a class "MRP123MenuItem" derived from
inbuilt MenuItem class to give customized look and feel to
the user. I've created context menus for different
controls using mine MRP123MenuItem's and it all works fine
except for ComboBox control. It only displays a strip of
context menus without any content. I'm unable to
understand why it is happening though it works fine when
used along with any other control.
Please help me out.

Nov 15 '05 #1
1 3554

-

I've created a class "MRP123MenuItem" derived from
inbuilt MenuItem class to give customized look and feel to
the user. I've created context menus for different
controls using mine MRP123MenuItem's and it all works fine
except for ComboBox control. It only displays a strip of
context menus without any content. I'm unable to
understand why it is happening though it works fine when
used along with any other control.
Please help me out.

Not sure if i understand your problem correctly. Here is what I tried and
it worked for me in VS 2003. net

I had my own MenuItem class:

public class MyMenuItem : MenuItem
{
public MyMenuItem (string name):base (name)
{
}
}
and then in my combobox control i did the following:

this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(88, 21);
this.comboBox1.TabIndex = 0;
this.comboBox1.Text = "comboBox1";
this.comboBox1.Items.Add ("Hello");
this.comboBox1.Items.Add("Hi");
ContextMenu menu = new ContextMenu ();;
MyMenuItem menuItem1 = new MyMenuItem ("hello");
menu.MenuItems.Add ((MenuItem)menuItem1);
this.comboBox1.ContextMenu = menu;
Right clicking on this combobox returns to me my context menu.

Hope this helps you out.

--
Adrian Mascarenhas, Developer Division

This posting is provided "AS IS" with no warranties, and confers no rights.

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.

Nov 15 '05 #2

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

Similar topics

4
by: Aaron Queenan | last post by:
How can I use the designer to add a context menu to a class which inherits from a control, e.g. treeview, without adding the context menu to a form? For example, to add a context menu with...
5
by: Dean L. Howen | last post by:
Dear friends, Could we determine when context menu should appear?
0
by: allen | last post by:
If I create a control library control (and change the base control from usercontrol to control). Add that control to the toolbox, then add that control to a windows form. Then add a context menu...
0
by: Andrew Baker | last post by:
Have a look at the code below. It's a really simple example where I have added two controls to a form, a textbox and a combo box. Both add owner drawn context menus to the controls, but the...
1
by: Chris Murphy via DotNetMonster.com | last post by:
Hi all, I'm just wondering if any one can help me with this development issue I'm having. I've created a customized treeview control to handle the particular tasks to which I'll be using it. Within...
1
by: stinehelferw | last post by:
I need a right-click menu on a form list control with combobox controls. I used View->Toolbars->Customize to create a toolbar. I added ComboBox through commands tab. I set properties to Popup...
2
by: Lucky | last post by:
hi guys, i'm working on the context menu for the controls. the problem i'm facing right now is like this : i want to use one context menu for more then one controls lets say i want to use one...
2
by: MCM | last post by:
I'm working on a plotting control. The plotting control will have a context menu with basic commands for "scaling", "zooming", etc. Is there a way that, from the parent form, I can add more...
4
by: PW | last post by:
Hi, What is one and does Access 2003 have one? Or how would I create one? I would like the user to be able to right-click on a form or a control on a form and have a menu that offers to go to a...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
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...
0
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...

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.