provide properties in design time by custom controls (.NET)
I create some control and i define some properties who can define in desing time, but only shows one. Another issue is t开发者_开发百科hat in the one shown, the textbox of the form was displayed, but i can't select any.
[Description("Blah Blah Blah"),
Category("Data"),
DefaultValueAttribute(typeof(TextBox), null),
Browsable(true)]
//Only show this one
public TextBox textBox
{
set { txt = value;}
}
[Description("Blah blah blah again"),
Category("Data"),
DefaultValueAttribute(typeof(string), null),
Browsable(true)]
public string Mensaje
{
set { sMensaje = value; }
}
so, what's wrong with my code
Your properties are missing getters.
// Snip attributes
public TextBox textBox
{
get { return txt; }
set { txt = value;}
}
// Snip attributes
public string Mensaje
{
get { return sMensaje; }
set { sMensaje = value; }
}
精彩评论