﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » ThemedLinkMenu in inherited form</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Fri, 22 May 2026 04:27:53 GMT</lastBuildDate><ttl>20</ttl><item><title>ThemedLinkMenu in inherited form</title><link>http://forum.strataframe.net/FindPost25320.aspx</link><description>Excuse me for the lot of questions I'm asking in the last days, but I'm just starting learn SF :crying:&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;What I'm missing?&lt;/P&gt;&lt;P&gt;Lot of thanks for your time.&lt;/P&gt;&lt;P&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Alex B.&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;</description><pubDate>Fri, 04 Dec 2009 09:17:28 GMT</pubDate><dc:creator>Alex Bibiano González</dc:creator></item><item><title>RE: ThemedLinkMenu in inherited form</title><link>http://forum.strataframe.net/FindPost25325.aspx</link><description>Hi Alex,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I see what you mean; the problem is that the &lt;EM&gt;ThemedLinkMenu&lt;/EM&gt; is marked &lt;STRONG&gt;&lt;EM&gt;Read-Only&lt;/EM&gt;&lt;/STRONG&gt; 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:&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { InitializeComponent();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ThemedLinkMenuItem themedLinkMenuItem1 = new ThemedLinkMenuItem();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; themedLinkMenuItem1.Key = "Exit";&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; themedLinkMenuItem1.Title = "Exit";&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; themedLinkMenu1.ItemCollection.Add( themedLinkMenuItem1 );&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face=Arial&gt;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&amp;nbsp;doesn't visually clear it from the ThemedLinkMenu. I'm sure Trent has thoughts on the matter.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face=Arial&gt;Les&lt;/FONT&gt;</description><pubDate>Fri, 04 Dec 2009 09:17:28 GMT</pubDate><dc:creator>Les Pinter</dc:creator></item><item><title>RE: ThemedLinkMenu in inherited form</title><link>http://forum.strataframe.net/FindPost25323.aspx</link><description>I have found a solution, but I'm not sure if it's the best. Comments are wilkome :)&lt;P&gt;I have creates LinkMenuItem class and collection like in the Strataflix sample.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;On the Form.Load event of the base class, I add all the LinkMenuItems from the collection to the ThemedLinkMenu:&lt;/P&gt;&lt;P&gt;[codesnippet]&lt;FONT size=2&gt;&lt;/P&gt;&lt;P&gt;themedLinkMenu1.BeginUpdate();&lt;/P&gt;&lt;P&gt;themedLinkMenu1.ItemCollection.Clear();&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;foreach&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; (&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;ActionLinkMenuItem&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; almi &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;in&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; ActionItems)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;themedLinkMenu1.ItemCollection.Add(almi);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;themedLinkMenu1.EndUpdate();&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;[/codesnippet]&lt;P&gt;Thanks,&lt;P&gt;Alex B.</description><pubDate>Fri, 04 Dec 2009 07:52:52 GMT</pubDate><dc:creator>Alex Bibiano González</dc:creator></item><item><title>RE: ThemedLinkMenu in inherited form</title><link>http://forum.strataframe.net/FindPost25322.aspx</link><description>Yes you are right, but there's still a problem.&lt;/P&gt;&lt;P&gt;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 &lt;STRONG&gt;base&lt;/STRONG&gt; form, you get a read-only ItemCollection in the inherited form.</description><pubDate>Fri, 04 Dec 2009 00:07:12 GMT</pubDate><dc:creator>Alex Bibiano González</dc:creator></item><item><title>RE: ThemedLinkMenu in inherited form</title><link>http://forum.strataframe.net/FindPost25321.aspx</link><description>Hi Alex,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 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?&lt;/P&gt;&lt;P&gt;Les</description><pubDate>Thu, 03 Dec 2009 18:49:41 GMT</pubDate><dc:creator>Les Pinter</dc:creator></item></channel></rss>