How to add custom Properties to a Forms control
Here we extend a textBox with new property
public class MyOwntextbox : TextBox
{
[Bindable(false)]
[Category("Properties")]
[DefaultValue("")]
[Localizable(true)]
public string MyTipPreText
{// This property will be available in Properties window - design mode
get
{
return tipPreText;
}
set
{
tipPreText = value;
}
}
public string tipPreText;
protected override void OnMouseHover(EventArgs e)
{
System.Windows.Forms.ToolTip t = new ToolTip();
t.SetToolTip(this, tipPreText + " is my Tipss");
}
}
class.