我正在尝试使用右侧的按钮制作TextBox.我的代码:
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();
}
}
Run Code Online (Sandbox Code Playgroud)
每次当我启动appi并在按钮中设置一些文本或图像时,它都是空的.一些想法?
最好的祝福.