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

Custom control for a ContextMenu control

I have a VB.NET application with two forms that contain a RichTextBox. I
have created a context menu for one of the RTF controls. I want the same
context menu to work for both. The no-brainer way to do it would be to
duplicate the code and controls in both forms. But there must be a better
way to handle this situation.

The answer likely involves a custom control of some type. I can't find a
reasonable reference that gets me started. Can someone point me to a Web
reference that contains information about creating a custom control based
upon a Context menu grouping.

Nov 21 '05 #1
1 1705
genojoe wrote:
I have a VB.NET application with two forms that contain a RichTextBox. I
have created a context menu for one of the RTF controls. I want the same
context menu to work for both. The no-brainer way to do it would be to
duplicate the code and controls in both forms. But there must be a better
way to handle this situation.

The answer likely involves a custom control of some type. I can't find a
reasonable reference that gets me started. Can someone point me to a Web
reference that contains information about creating a custom control based
upon a Context menu grouping.


Just create a class that contains all the code for your context menu.
More than likely just inherit from the basic context menu class. Then
you can have as many controls use them as you like. If I don't
understand your question, so sorry.

Chris
Nov 21 '05 #2

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

Similar topics

0
by: ttupper | last post by:
I have made a custom control that has a property that is a custom component. When I put the custom control on a form in the designer, the propery is listed in the Properties window with a default...
1
by: Abhi | last post by:
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...
2
by: Ryan Joseph So | last post by:
Is it possible to disable the paste contextmenu of a control without creating a new contextmenu to handle this, so i wont be able use to paste on that control. Ryan. *** Sent via...
2
by: Zieben | last post by:
Hello! I have such problem! I have my UserControl. I override property ContextMenu for this Control as ..... new ContextMenu ContextMenu{ set {_contextMenu = value;}
3
by: Bob | last post by:
My control pops a menu (below, not directly under, the pointer) OnMouseDown, and, probably because of the loss of focus, OnDoubleClick doesn't fire any more. Is there a way to get doubleclick back...
1
by: Rulin Hong | last post by:
Menu "Paste" in textbox control's built-in contextmenu will be automaticaly enabled while having text in clipboard. I want to disable the menu when text in clipboard didn't meet my format. I...
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...
2
by: AMDRIT | last post by:
Hello everyone, I have created a custom component and one of its properties is a class object with it's own properties. During runtime, I can assign values to the class object properties just...
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...
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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,...
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...

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.