Static Property

  • Thread starter Thread starter victor
  • Start date Start date
V

victor

Hi,
Is it possible to create a Button control as a static property, via
the Form Designer, so that the instantiating code in the wizard
generated 'InitializeComponent()' need not to be modified?
I mean, I can add 'static' at the public declaration but then I also
need to change the auto-generated InitializeComponent() section
(remove the 'this') which is not advisable.

Any ideas? Thanks!
victor
 
<victor>,

I don't know if you can do it from the designer. I really doubt it. I don't
see how a control can be a static.

You can create many instances of a form. Each control has underlaying native
windows, which can have only one parent.
I don't see how you can share a control between forms.

Even if you say that you are going to guarantee only one istance (singleton)
the windows forms designer is not meant to create singleton forms.
 
Fine, thank you for responding. I was afraid of this outcome ...;
well, I'll try another way. Maybe a class argumented with the base
form will do .... .
cheers.
 

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