【问题标题】:Problems Making DevExpress SimpleButton Visible At Runtime使 DevExpress SimpleButton 在运行时可见的问题
【发布时间】:2012-03-26 13:53:16
【问题描述】:

我正在开发一个使用一些 DevExpress 控件的 C# WinForms 应用程序。我正在努力弄清楚为什么我不能通过将隐藏的 SimpleButton 的 Visible 属性设置为 true 来在运行时使其可见。我试图赋予控件焦点,刷新控件,刷新表单无济于事。我在调试器中注意到的一件事是,在语句 btnAddJob.Visible = true 之后,Visible 属性仍然为 false。有什么想法吗?

    public AddPredefinedJobsForm(WorkOrder workOrder)
        : this()
    {
        currentWorkOrder = workOrder;
        // Here I am just getting the position to display the button
        btnAddJob.Location = new Point(btnNewJob.Location.X, btnNewJob.Location.Y);
        // Hiding the button that my hidden button will replace below
        btnNewJob.Visible = false;
        // Give my hidden button focus
        btnAddJob.Focus();
        // Make my hidden button Visible
        btnAddJob.Visible = true;
        // Refresh the button
        btnAddJob.Refresh();

        // Refresh the entire form
        this.Refresh();

    }

【问题讨论】:

    标签: c# winforms devexpress


    【解决方案1】:

    如果您在容器控件(如Panel)中有按钮,则需要将容器的可见性设置为True,以便其子控件可见。

    【讨论】:

    • 谢谢,我是个新手。那成功了。该按钮位于 groupControl 中,它解释了我遇到的行为。
    猜你喜欢
    • 1970-01-01
    • 2011-06-30
    • 1970-01-01
    • 2018-05-06
    • 1970-01-01
    • 1970-01-01
    • 2021-10-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多