I see what you mean; the problem is that the ThemedLinkMenu is marked Read-Only when inherited if the Collection contains any items. That's probably by design, although you can get around it by adding the initial selections in code in the base form's constructor:
{ InitializeComponent(); ThemedLinkMenuItem themedLinkMenuItem1 = new ThemedLinkMenuItem(); themedLinkMenuItem1.Key = "Exit"; themedLinkMenuItem1.Title = "Exit"; themedLinkMenu1.ItemCollection.Add( themedLinkMenuItem1 );
But your event handler in the forms that derive from it need to handle the default ("Exit" in this case). I also noticed that removing a ThemedLinkMenuItem in the base form's Items Collection doesn't visually clear it from the ThemedLinkMenu. I'm sure Trent has thoughts on the matter.
Les
I have creates LinkMenuItem class and collection like in the Strataflix sample.
I have published the collection through a public property of the base form, so I can add new LinkMenuItems to the collection in the inherited forms.
On the Form.Load event of the base class, I add all the LinkMenuItems from the collection to the ThemedLinkMenu:
themedLinkMenu1.BeginUpdate();
themedLinkMenu1.ItemCollection.Clear();
{
themedLinkMenu1.ItemCollection.Add(almi);
}
themedLinkMenu1.EndUpdate();
Thanks,
Alex B.
When you add a item to the collection on the base form. If there's an ActionLinkMenuItem to the the itemcollection from the ActionLinkeMenu at the base form, you get a read-only ItemCollection in the inherited form.
I hope I understood you correctly. I created a form named MainForm, then added a ThemedLinkMenu. I then set its Modifiers property (under Design properties) to Public. Finally, I add another form that inherits from MainForm, and I'm able to add to its ItemCollection, and to respond to the Click event of the ItemCollection and identify which item was clicked. Does that come anywhere near the issue you describe?
I have just created a base form with a ThemedLinkMenu. Now I have inherited some forms and want to add diferent ThemedLinkMenuItem's, but the item's collection is readonly in the derived forms. I have already changed the ThemedLinkMenu modifier to protected, but it's still readonly.
What I'm missing?
Lot of thanks for your time.