Delete control from inherited form

R

Robert Scheer

Hi.

I am playing a bit with visual inheritance in vb.net. I created a base
form with two buttons, one of them has its Modifiers property set to
public. When I derive a new form from my base form I can resize and
change the behaviour of my public button, but I can't delete it. When
using visual inheritance isn't it possible to remove controls?

Thanks,

Robert Scheer
 
J

Jay B. Harlow [MVP - Outlook]

Robert,
When using visual inheritance isn't it possible to remove controls?
No. The base form 'needs' it, if you were able to delete it, the base form
may no longer work correctly. Correct?

I would think if it did not need to be visible on the derived form, then you
would hide the control. The base form could still interact with it as
normal, but it would not be visible on the derived form. Of course this is
with the understanding the base form allows it to be hidden...

Hope this helps
Jay
 
H

Herfried K. Wagner [MVP]

Hello,

Robert Scheer said:
I am playing a bit with visual inheritance in vb.net. I created a base
form with two buttons, one of them has its Modifiers property set to
public. When I derive a new form from my base form I can resize and
change the behaviour of my public button, but I can't delete it. When
using visual inheritance isn't it possible to remove controls?

You cannot delete an inherited control in a derived form.

HTH,
Herfried K. Wagner
 

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

Top