471,627 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,627 software developers and data experts.

Static Property

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
Feb 1 '06 #1
2 1198
<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.
--

Stoitcho Goutsev (100)
<victor> wrote in message news:56********************************@4ax.com...
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

Feb 1 '06 #2
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.

On Wed, 1 Feb 2006 09:32:26 -0500, "Stoitcho Goutsev \(100\)"
<10*@100.com> wrote:
<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.


Feb 1 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by Sergey Klementiev | last post: by
3 posts views Thread by bauscharln | last post: by
6 posts views Thread by RSH | last post: by
8 posts views Thread by Per Bull Holmen | last post: by
5 posts views Thread by Dave | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.