StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Visual Inheritance and PanelManagerExpand / Collapse
Author
Message
Posted 11/21/2006 5:25:10 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 11/25/2008 10:33:22 AM
Posts: 318, Visits: 460
I am using visual inheritance extensively and have created a number of "base forms" to use.  One I am working on at the moment is using the PanelManager and has several Pages.  This works fine and the code executes correctly.  However, when I try to look at the inherited form in the designer I get "Duplicate component name 'PageBlank'. Component names must be unique and case-insensitive." for each page that I have in the PanelManager.  Basically, it looks like it's trying to recreate those components in the inherited form when it really doesn't need to.  Any idea on how I can get around this?  I know VI has some issues, but DevExpress has helped with a lot of those and I am usually able to make it work right.  Any help would be great.
Post #4713
Posted 11/28/2006 9:49:39 AM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 11/25/2008 10:33:22 AM
Posts: 318, Visits: 460
I am still having this issue.  I have this error coming up every time I try to look at the inherited form in the designer.  Is there a workaround here?  I don't understand why it's trying to recreate the panel pages, but I don't have a problem with any of the other controls...including panels that are outside of a panel manager.  It seems to be only the panels contained within a panel manager.  Right now I have to go into the designer code and delete the references to the panels every time I want to look at this form in the designer.  I really need this to work correctly.
Post #4794
Posted 11/28/2006 9:59:47 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 11:24:42 AM
Posts: 2,686, Visits: 1,889
The problem is with the forms designer... it reflects over your form to determine the properties that need to be serialized into the InitializeComponent() method.  So, when you add your pages the first time, they are added to the InitializeComponent() method.  However, when you inherit the form, and open the subform in the designer, it reflects over the object again, sees those pages and thinks it needs to add them to the subform's InitializeComponent() method because it doesn't know that they've already been added to the superclass's InitializeComponent() (for that matter, it doesn't even know that there is already an InitializeComponent() method in the superclass, so...). 

Unfortunately, you cannot access the Me.DesignMode property of a control within the constructor (because the property hasn't been set yet).  So, you'll have to come up with some other type of flag that will indicate whether the form is within design mode, and if it's not in design mode (meaning it's runtime), you'll want to Clear() the pages collection of the panel manager before the InitializeComponent() is called in the inherited form.


www.bungie.net
Post #4795
Posted 11/28/2006 11:40:06 AM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 11/25/2008 10:33:22 AM
Posts: 318, Visits: 460

 

Ok, I get what you are saying...what I don't get is why this is a problem here and not other places.  Why is this the only control giving me a problem?  I have done what you suggested and cleared the page collection before the InitializeComponent inside the constructor.  This did not change anything for me.  Any other suggestions?

Post #4807
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 1:34pm

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.109. 12 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.