If disabling the control is enough the simplest solution is to use UPDATE_UI events, but those events cannot be used to hide and show controls.
Dynamically hiding a control requires a few lines of code, but this feature is not very well documented.
Suppose that m_Control is a pointer to the control to be hidden, and that m_Sizer is a pointer to the sizer that contains that control. The following code, in a method of a wxDialog-derived window, hides the control at run time, rearranging the other controls and the window to reuse the resulting empty space:
m_Sizer->Hide( m_Control );
m_Sizer->Layout();GetSizer()->SetSizeHints(this);
No comments:
Post a Comment