I want to make a custom property for a windows form browsable during design-time but none of my efforts have panned out to success. The obvious solution would seem to be to set the browsable attribute to true:
[Browsable(true),
EditorBrowsable(EditorBrowsableState.Always),
Description("Custom Border Colour"),
Category("Custom")]
public Color BorderColour
{
get
{
return bCol;
}
set
{
bCol = value;
}
}
But this doesn't work. I have done it numerous time for custom controls and it works like a charm, in fact, I don't even need to add the attributes because the default is true. This codeproject article seems to do what I want, which is what I described above. MSDN is also a dead end, or I don't know what to search for.
I have tried to add the code to Form1.cs
and From1.Designer.cs
but nothing works.
Is there something I am missing, like some property I need to set for the form to allow for this, or is it just impossible?
I am using Visual Studio Express 2013, if this would influence the outcomes in any way.
EDIT: Attempts after Reza's answer: A more detailed question on this topic is asked in this question as per Reza's suggestion.