c# - Windows Form inheritance -


I want to create a bunch of forms which are all the same properties and the parameters of the constructor.

I tried to create a class that comes from the form and after that there are succession of that class from all my classes, but I think that since I can not say InitializeComponent () So I had some problems.

Is there some C # code on how to do this?

parent code> initial component to your constructor call base < / Code> should be called in such a way:

  public YourFormName (): base () {//. ..}  

(You must have call manufacturer for initializeComponent in your original form. Did you not take it, did you?)

< P> However, the road you are traveling to is not like that will play well with the designer, because you will not be able to get it to work with your parameters to instantize your form on time To provide a parametric constructor Ga). You will also take part in issues where it provides parental properties for the second time, or they designate your parametric constructor to be different from what you wanted to use in the code.

Instead of using a constructor with parameters, on the form for the property form, you will have a headache.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -