Sorry, I hit enter before I finished writing the previous post... ignore
that one. :-)

====

all,

I made a composite control ("TitleBar") consisting of a Panel that in turn
holds an Image and a Label. The Text property of this control just gets or
sets the text in the Label; nothing fancy (see below).

At design-time, if I change the Text property of the control once it's in a
form, it appears fine. But if I close the designer and re-open it, the text
is gone. What gives?

Any help is appreciated. Thanks!

[Category("Appearance")]
[Description("The title text to be displayed.")]
[Browsable(true)]
public override string Text
{
get
{
return this.f_Label.Text;
}
set
{
this.f_Label.Text = value;
}
}

Re: Composite controls don't persist data? (sorry, repost) by Kyle

Kyle
Mon Jun 12 19:59:07 CDT 2006

I forgot to mention this, but this is in .NET 2.0, if that makes any
difference.

thanks,
- Kyle

"Kyle Kaitan" <kkaitan@gmail.com> wrote in message
news:%23Z3LvgnjGHA.1600@TK2MSFTNGP04.phx.gbl...
> Sorry, I hit enter before I finished writing the previous post... ignore
> that one. :-)
>
> ====
>
> all,
>
> I made a composite control ("TitleBar") consisting of a Panel that in turn
> holds an Image and a Label. The Text property of this control just gets or
> sets the text in the Label; nothing fancy (see below).
>
> At design-time, if I change the Text property of the control once it's in
> a form, it appears fine. But if I close the designer and re-open it, the
> text is gone. What gives?
>
> Any help is appreciated. Thanks!
>
> [Category("Appearance")]
> [Description("The title text to be displayed.")]
> [Browsable(true)]
> public override string Text
> {
> get
> {
> return this.f_Label.Text;
> }
> set
> {
> this.f_Label.Text = value;
> }
> }
>



Re: Composite controls don't persist data? (sorry, repost) by Rob

Rob
Tue Jun 13 16:59:51 CDT 2006

I don't understand exactly why (so maybe somebody else will expand) but I
had the same thing earlier on today. It's something to do with the fact
that 'Text' is an existing property, so you have to use MyBase.Text
something like (apologies, but I'm a VB type... hopefully this will
translate)....

In the Get...

Return MyBase.Text

In the Set....

MyBase.Text=Value
f_label.text=Value


"Kyle Kaitan" <kkaitan@gmail.com> wrote in message
news:ugoBZSojGHA.4508@TK2MSFTNGP05.phx.gbl...
> I forgot to mention this, but this is in .NET 2.0, if that makes any
> difference.
>
> thanks,
> - Kyle
>
> "Kyle Kaitan" <kkaitan@gmail.com> wrote in message
> news:%23Z3LvgnjGHA.1600@TK2MSFTNGP04.phx.gbl...
> > Sorry, I hit enter before I finished writing the previous post... ignore
> > that one. :-)
> >
> > ====
> >
> > all,
> >
> > I made a composite control ("TitleBar") consisting of a Panel that in
turn
> > holds an Image and a Label. The Text property of this control just gets
or
> > sets the text in the Label; nothing fancy (see below).
> >
> > At design-time, if I change the Text property of the control once it's
in
> > a form, it appears fine. But if I close the designer and re-open it, the
> > text is gone. What gives?
> >
> > Any help is appreciated. Thanks!
> >
> > [Category("Appearance")]
> > [Description("The title text to be displayed.")]
> > [Browsable(true)]
> > public override string Text
> > {
> > get
> > {
> > return this.f_Label.Text;
> > }
> > set
> > {
> > this.f_Label.Text = value;
> > }
> > }
> >
>
>



Re: Composite controls don't persist data? (sorry, repost) by Laurent

Laurent
Wed Jun 14 03:17:48 CDT 2006

Hi,

I also made composite control with Text overridden and works fine, try to
add this attributes to the Text property.

[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]




"Kyle Kaitan" <kkaitan@gmail.com> a écrit dans le message de news:
%23Z3LvgnjGHA.1600@TK2MSFTNGP04.phx.gbl...
> Sorry, I hit enter before I finished writing the previous post... ignore
> that one. :-)
>
> ====
>
> all,
>
> I made a composite control ("TitleBar") consisting of a Panel that in turn
> holds an Image and a Label. The Text property of this control just gets or
> sets the text in the Label; nothing fancy (see below).
>
> At design-time, if I change the Text property of the control once it's in
> a form, it appears fine. But if I close the designer and re-open it, the
> text is gone. What gives?
>
> Any help is appreciated. Thanks!
>
> [Category("Appearance")]
> [Description("The title text to be displayed.")]
> [Browsable(true)]
> public override string Text
> {
> get
> {
> return this.f_Label.Text;
> }
> set
> {
> this.f_Label.Text = value;
> }
> }
>