I'm trying to make a TextBox with a button on the right side. My code:
public partial class TextBoxButton : TextBox
{
[Category("Button")]
[Description("Button in textbox")]
public Button Button
{
get
{
return this.btn;
}
set
{
this.btn = value;
}
}
protected override void OnCreateControl()
{
if (!this.Controls.Contains(this.btn))
{
this.Controls.Add(this.btn);
this.btn.Dock = DockStyle.Right;
}
base.OnCreateControl();
}
}
Everytime when I start my appi and set some text or image in the button it's empty. Some ideas?
Best regards.