【发布时间】: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