2021-05-21 仓库温控系统(Winform) 16 扩展控件-PageButton

Posted 微软MVP Eleven

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了2021-05-21 仓库温控系统(Winform) 16 扩展控件-PageButton相关的知识,希望对你有一定的参考价值。

[DefaultEvent("Click")]
public partial class UPageButton : UserControl
{
    public UPageButton()
    {
        InitializeComponent();
    }

    /// <summary>
    /// 按钮文本
    /// </summary>
    public string BtnText
    {
        get { return lblText.Text; }
        set { lblText.Text = value; }
    }

    public override Color ForeColor { get => lblText.ForeColor; set => lblText.ForeColor = value; }

    protected override void OnClick(EventArgs e)
    {
        lblText.ForeColor = Color.FromArgb(45, 50, 116);
        base.OnClick(e);
    }

    private void lblText_Click(object sender, EventArgs e)
    {
        this.OnClick(e);
    }
}

以上是关于2021-05-21 仓库温控系统(Winform) 16 扩展控件-PageButton的主要内容,如果未能解决你的问题,请参考以下文章