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


Disable themed link menu on main form from editingstatechanged of MDI...
Author
Message
Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (892 reputation)Advanced StrataFrame User (892 reputation)Advanced StrataFrame User (892 reputation)Advanced StrataFrame User (892 reputation)Advanced StrataFrame User (892 reputation)Advanced StrataFrame User (892 reputation)Advanced StrataFrame User (892 reputation)Advanced StrataFrame User (892 reputation)Advanced StrataFrame User (892 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
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



Edhy Rijo
E
StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
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.

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search