StrataFrame Forum

Disable themed link menu on main form from editingstatechanged of MDI child?

http://forum.strataframe.net/Topic30925.aspx

By Charles R Hankey - 2/14/2012

I a themed link menu that opens MDI children on the main form.  Inside a child form I can see a ParentForm reference to the frmMainForm but I can't see a reference to the ThemedLinkMenu ( tlmAction ) so I can set it as enabled = false.

The request from the client is to not allow opening another form while the current form is editing and this seemed the most straightforward way to accomplish this though I'm open to other suggestions. 

I planed to see the tlmAction.Enbled = false in my EditStateChanged of each form.

Tried a public property in frmMainForm which was a reference to the TLM

        public MicroFour.StrataFrame.UI.Windows.Forms.ThemedLinkMenu tlm { getset; }
(then inside constructor )

tlm = this.tlmAction ;

But I see no ref to this property when looking at ParentForm inside my other forms.

Thought about trying to cancel in the leave of the form but can't find anything in the args to do that. Suggestions for a form-event approach?

either disabling the TLM or preventing leaving the form until there is an undo or save would work for me.

Seems there is a more elegant way to accomplish this but I can't wrap my head around it.

Thanks in advance


By Edhy Rijo - 2/14/2012

Hi Charles,

The StrataFlix sample uses an approach that will allow you to do just that.  The TLM uses Action Link Menu Items, so in your base form class you would have a property as New ActionLinkMenuItemCollection which is a class in the StrataFlix project to hold all the action menu items.  There are more code to Enable/Disable items.

In your case if you have a parent form with the TML and a child form which is not a Dialog Form, then you would either add code to your child form to see if an instance already exist and just use that instance instead of opening a new one.