Q: On inherited forms with controls.

  • Thread starter Martin Arvidsson
  • Start date
M

Martin Arvidsson

Hi!

I have created a form with a couple of controls and public methods.

In the second form i want to inherit the first form so i issue

public class NewForm : InheritFromForm
{
and so on
}

When showing NewForm in the designer, all the controls are locked and i
can't move them, is there a way to get around this, since i may want to
disable a button in the NewForm but not in the InheritFromForm.

Why you may ask, answer is simple, we have customers who wants special
functions and so on in a form. So instead of creating a new form with their
functions i want to inherit the functions. But i didn't think the inherited
controls would be locked :(

Any tips?

Regards
Martin Arvidsson
 
N

Nicholas Paldino [.NET/C# MVP]

Martin,

In the base form, are the controls private or protected? By default,
they are probably private, so you will have to change the access modifier to
protected so your derived forms can access them.

Hope this helps.
 

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