相关疑难解决方法(0)

如何在文本框中添加按钮?

我正在尝试使用右侧的按钮制作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并在按钮中设置一些文本或图像时,它都是空的.一些想法?

最好的祝福.

c# winforms

0
推荐指数
1
解决办法
2万
查看次数

标签 统计

c# ×1

winforms ×1