newbie: a little problem with visual inheritance

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

IDE: Visual Studio 2003 .NET
OS: XP Pro

I created a form which I placed a tab-controll on. Then I created another
form by inheriting from this one. Then I opened the newly created form, and
sees that the inherited form contains the tab-controll. (from the ancestor
form).. everything is ok....

Then I remove the tab-controll from the ancestor. rebuild the solution and
then opens the form (the one that inherit from ancestor). But the
tab-controll is still there....

The ancestor form is in a different assembly, but when I build the solution
that assembly is beeing build also, so as far as know that shouldn't matter
(but, I'm a newbie)

Please, what's wrong here???

Jeff
 
I found the reason. When I build the solution a new copy of the assembly
containing the ancestor isn't copied to the main project. I have to do it
manually....
 
In inherited controls you cannot remove things. You can only add things.
Since the code exists in the base class, the child class (form) does not
have access to it. If you want to remove a control from the parent, then
you really do NOT want what the parent has to offer, therefore you should
not be using the parent but instead should create a new parent that has what
you want instead. You can of course add code to hide or remove it in Code
view, but the designer only sees what is in the InitializeComponent which
you cant modify since you dont have access to it




JIM
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top