Jump to content
Xtreme .Net Talk

Recommended Posts

  • Leaders
Posted

I am making a component that inherits from MenuItem, and another that inherits from MainMenu to contain my menu items. Much of the behavior of my menu items depends on properties of the MainMenu.

 

My menu items can display images from an imagelist specified as a property of my main menu. I have implemented the ImageIndex and ImageList properties exactly as I have seen in many examples, like so:

 

   'Specify Design time category, editor, and type converter
   <Category("Appearance"), _
   Description("Image from specified image list to be displayed for this menu item, if nothing is specified for the property ""Image"""), _
   Editor("System.Windows.Forms.Design.ImageIndexEditor", _ 
   GetType(System.Drawing.Design.UITypeEditor)), TypeConverter(GetType(ImageIndexConverter))> _
   Public Property ImageIndex() As Integer
       Get
           Return _ImageIndex
       End Get
       Set(ByVal Value As Integer)
           _ImageIndex = Value
       End Set
   End Property
'
   'Necessary for design time ImageIndex editor
   <EditorBrowsable(EditorBrowsableState.Advanced), _
   Browsable(False)> _
   ReadOnly Property ImageList() As ImageList
       Get
           If _MainMenu Is Nothing Then
               FindParents() 'Find the containing MainMenu if necessary
           End If
           If _MainMenu.ImageList Is Nothing Then MsgBox("This is the problem")
           Return _MainMenu.ImageList
       End Get
   End Property

 

My problem is a designer problem.

The thumbnails don't show up during design time when I am selecting the image index in the property grid. The available indecies and "(none)" appear in the dropdown list, just not the thumbnails.

[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...