Color property returns Color.Empty to my control

Discussion in 'ASP .Net Building Controls' started by Brendon, Mar 23, 2005.

  1. Brendon

    Brendon Guest

    I have written a custom composite control. When I try to get the value of a
    Color property I always get Color.Empty in the designer, but I do get the
    color that is selected when the webpage is run. Does anyone know if I have
    to do something specific to get the value of the color back into the
    designer? I have included the property that I am adding to the control.

    Thanks,
    Brendon

    [Description("Display the color of the Header." ),
    Category("UGEvent"),
    NotifyParentProperty(true),
    Bindable(true),
    TypeConverter(typeof(WebColorConverter)) ]
    public Color HeaderColor
    {
    get
    {
    EnsureChildControls() ;
    return this._HeaderColor ;
    }
    set
    {
    EnsureChildControls() ;
    this._HeaderColor = (Color) value ;

    }
    } //End HeaderColor
     
    Brendon, Mar 23, 2005
    #1
    1. Advertising

  2. Jason Bentley, Mar 24, 2005
    #2
    1. Advertising

  3. Brendon

    Brendon Guest

    Nope I sure didn't. Is that why it can't set the property value? Here are
    the attributes I used.

    [Description("Display the color of the Header." ),
    Category("UGEvent"),
    NotifyParentProperty(true),
    Bindable(true),
    TypeConverter(typeof(WebColorConverter)) ]

    Thanks for the help,
    Brendon

    "Jason Bentley" wrote:

    > Brendon, are you setting a default value for the private _HeaderColor
    > value?
    >
    > Jason Bentley
    > http://geekswithblogs.net/jbentley
    >
    >
     
    Brendon, Mar 24, 2005
    #3
  4. Jason Bentley, Mar 24, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vizlab
    Replies:
    3
    Views:
    4,221
    Michael Bar-Sinai
    Oct 17, 2007
  2. ButlerDJIAM
    Replies:
    0
    Views:
    568
    ButlerDJIAM
    Nov 9, 2006
  3. ++imanshu
    Replies:
    7
    Views:
    479
    ++imanshu
    Aug 23, 2008
  4. Trans
    Replies:
    2
    Views:
    232
    Trans
    Nov 6, 2005
  5. Kamaljeet Saini
    Replies:
    0
    Views:
    434
    Kamaljeet Saini
    Feb 13, 2009
Loading...

Share This Page