我正在使用一些使用一些DevExpress控件的C#WinForms应用程序。我正在努力弄清楚为什么我不能通过将其'Visible属性设置为true来使隐藏的SimpleButton在运行时可见。我试图给控制焦点,刷新控件,刷新表单无济于事。我在调试器中注意到的一件事是,在语句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();
}