Custom ToolStripMenuItem


L

Larry Dodd

I have written a class that should add a custom ToolStripMenuItem to the
designer of the ToolStrip control in my current project. When i recompile the
project everything seems to compile fine but I do not have the menu item on
the designer of the MenuStrip or the ToolStrip. The odd thing is if I create
a new project and add this class to the project the Custom MenuItem will
appear on the MenuStrip designer. The project that it won't appear in is a
project that was upgraded from VB6 so I'm not sure it that has something to
do with it. Please HELP!!!

Imports System.Windows.Forms.Design

<ToolStripItemDesignerAvailability((ToolStripItemDesignerAvailability.ToolStrip Or ToolStripItemDesignerAvailability.MenuStrip))> _
Public Class CorpProMenuItem
Inherits System.Windows.Forms.ToolStripMenuItem

Private _Caption As String

Public Property Caption() As String
Get
Return _Caption
End Get
Set(ByVal value As String)
_Caption = value
End Set
End Property

End Class
 
Ad

Advertisements

L

Larry Dodd

Is there really no one that has seen this problem before. I was hoping for a
little help from the community.
 
Ad

Advertisements

Joined
Nov 28, 2008
Messages
1
Reaction score
0
Re:

Try using the ToolStripItemDesignerAvailabilityAttribute on your custom MenuItem class.
For e.g.
[
ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.All)]
public class CustomMenuItem : ToolStripMenuItem

HTH
Vikas

 

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