Inherited Forms and menu strip question
Inherited Forms and menu strip question
Inherited Forms and menu strip question
Inherited Forms and menu strip question
Inherited Forms and menu strip question
Inherited Forms and menu strip question Inherited Forms and menu strip question Inherited Forms and menu strip question Inherited Forms and menu strip question Inherited Forms and menu strip question Inherited Forms and menu strip question Inherited Forms and menu strip question Inherited Forms and menu strip question
Inherited Forms and menu strip question Inherited Forms and menu strip question
Inherited Forms and menu strip question
Go Back  Xtreme Visual Basic Talk > > > Inherited Forms and menu strip question


Reply
 
Thread Tools Display Modes
  #1  
Old 01-28-2013, 09:29 AM
RM33 RM33 is offline
Newcomer
 
Join Date: Jan 2013
Posts: 20
Default Inherited Forms and menu strip question


I am using VB 2010.

I am creating a WinForm app. ( I know, I know why WinForm. The boss wants it. ) I wanted to create a parent form. Then I wanted to create child forms off the parent form. So I am using inherited forms. I put a menustrip on the parent form.

So I created a child form. When I tried to make changes to the menustrip on the child form, it was locked. Apparently, I can only make changes to the parrent menustrip.

What can I do about this. I was hoping of having one menustrip that take care of most forms. And then just make changes where needed. Not all forms need a menu.
Reply With Quote
  #2  
Old 01-28-2013, 03:55 PM
snarfblam's Avatar
snarfblamInherited Forms and menu strip question snarfblam is offline
Senior Contributor

Forum Leader
* Expert *
 
Join Date: Apr 2005
Location: USA
Posts: 896
Default

Quote:
Originally Posted by Gruff View Post
Not sure what kind of VB project you are referring to here.
The designer supports forms that inherit another form created by the designer. I suppose you could think of the base form as a "template" onto which other forms are created. It's called "visual inheritance".

I don't know all the ins and outs of working with inherited forms. I'm personally not very fond of the feature so I have little experience with it.

Apparently, from what I understand, modifying things like toolstrips and menus is not supported in inherited forms. I did find an article that explains how to use menu/toolstrip merging to get the same effect.
__________________
C# _VB.NET _
Reply With Quote
  #3  
Old 01-28-2013, 05:30 PM
AtmaWeapon's Avatar
AtmaWeaponInherited Forms and menu strip question AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

Every time I've used form inheritance I've encountered problems like this, so I quit using it. It'd honestly be easier to keep the forms separate. In the long run, it's actually easier to write infrastructure that generates MenuStrips and ToolStrips from available commands than it is to fiddle with them in UI anyway.
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
  #4  
Old 01-29-2013, 03:28 AM
DrPunk's Avatar
DrPunkInherited Forms and menu strip question DrPunk is offline
Senior Contributor

* Expert *
 
Join Date: Apr 2003
Location: Never where I want to be
Posts: 1,403
Default

To get access to the controls on an inherited form you generally have to declare them as Protected rather than the Friend it defaults to. You can change the Modifier of the control in the IDE. It's a property of the control.

But having said that, MenuStrip is one of those controls that just doesn't work properly in the IDE when inherited. There's a few others. Mostly the -Strips. You just have to do things programmatically instead.
__________________
There are no computers in heaven!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Inherited Forms and menu strip question
Inherited Forms and menu strip question
Inherited Forms and menu strip question Inherited Forms and menu strip question
Inherited Forms and menu strip question
Inherited Forms and menu strip question
Inherited Forms and menu strip question Inherited Forms and menu strip question Inherited Forms and menu strip question Inherited Forms and menu strip question Inherited Forms and menu strip question Inherited Forms and menu strip question Inherited Forms and menu strip question
Inherited Forms and menu strip question
Inherited Forms and menu strip question
 
Inherited Forms and menu strip question
Inherited Forms and menu strip question
 
-->