Static Property

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • victor

    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 'InitializeComp onent()' 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 InitializeCompo nent() section
    (remove the 'this') which is not advisable.

    Any ideas? Thanks!
    victor
  • Stoitcho Goutsev \(100\)

    #2
    Re: Static Property

    <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:5631u1p7jn du2p3onlmj8n205 qe8vhjsj7@4ax.c om...[color=blue]
    > 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 'InitializeComp onent()' 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 InitializeCompo nent() section
    > (remove the 'this') which is not advisable.
    >
    > Any ideas? Thanks!
    > victor[/color]


    Comment

    • victor

      #3
      Re: Static Property

      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\)"
      <100@100.com> wrote:
      [color=blue]
      ><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.[/color]

      Comment

      Working...