Custom control for a ContextMenu control

G

Guest

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.
 
C

Chris

genojoe said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top