views:

74

answers:

1

I'm creating a control with properties of type System.Net.IPAddress. The designer shows these as read-only, and seems to be matching them up with resources. Is there a way to make it so that the user can edit these properties in the designer properties window, rather than having to open up the resource editor?

+1  A: 

Found it - the answer is to fake it:

[Browsable(true)]
[DisplayName("IPAddress")]
public string IPAddressText
{
    get { return this.IPAddress.ToString(); }
    set { this.IPAddress = IPAddress.Parse(value); }
}

[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public IPAddress IPAddress
{
    get;
    set;
}
Simon