Search code examples
wxwidgets

How to hide/show wxPanel at runtime?


I want to make a panel on form visible/invisible at runtime like this:

wxPanel* wxp;
wxp->Hide();
...
wxp->Show();

Is it possible in some way?


Solution

  • You should be able to do it exactly like that as wxPanel inherits from wxWindow which provides methods called Hide and Show.

    So the following code should work:

    wxPanel* wxp = new wxPanel(parent);
    wxp->Hide();
    ...
    wxp->Show();