MARCELL0US Posted April 5, 2003 Posted April 5, 2003 Sup, I am looking to enable/disable menu options on a parent form, from inside a child form subroutine. After doing some searching I found that someone accomplished this by using: MdiParent.Menu.MenuItems[0].MenuItems[0].Enabled = False However, when I tried using this (and many variations), I got the following tooltip style pop-up message: Property access must assign to the property or use its value Does anyone have an info that could help a brother out? Thanks, Quote
Negative0 Posted April 6, 2003 Posted April 6, 2003 Use parentheses instead of brackets: MdiParent.Menu.MenuItems(0).MenuItems(0).Enabled = False Hope this helps, Quote
Guest mutant Posted April 6, 2003 Posted April 6, 2003 He might be using C# and in C# its brackets instead of (). BTW, that code works fine for me, are you you have a menu at that position?(0,0) Quote
Negative0 Posted April 6, 2003 Posted April 6, 2003 I thought about the fact he may be using C#, but if you use his code in VB, you get the exact error message that he mentioned. That is why I assumed he was using VB. Quote
Guest mutant Posted April 6, 2003 Posted April 6, 2003 Im sorry then :) , I was testing it in C#. Quote
MARCELL0US Posted April 6, 2003 Author Posted April 6, 2003 Toolbar Hiding, ToolbarButton enabling Thanks. You guys were right about the parens instead of brackets. I ended up figured it out after a couple HOURS. Grr. I'm more comfortable in C++ but am using VB to get used to it. Actually, I have another problem that I haven't found a solution for: How would I go about hiding/showing the toolbar on a parent from the child form. Same for enabling/disabling buttons on that toolbar? Thanks again, Quote
*Gurus* divil Posted April 6, 2003 *Gurus* Posted April 6, 2003 You will have to cast the MdiParent property to the actual type of your form, which will enable you to access its members (such as the toolbar). DirectCast(Me.MdiParent, Form1).Toolbar.Blah Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.