Code: Select all
MyFrame::MyFrame(const wxString &Title):wxFrame(NULL,MyFrame_ID,wxT("parent Frame"),wxDefaultPosition,wxSize(1000,700))
{
Connect(ID_CNR,wxEVT_COMMAND_BUTTON_CLICKED,wxCommandEventHandler(MyFrame::OnChoice1));
}
void MyFrame::OnChoice1(wxCommandEvent &Event)
{
Frame2=new wxFrame(this,20,wxT("Frame2"),wxDefaultPosition,wxSize(400,300));
Frame2->Show(true);
Connect(ID_CREATE,wxEVT_COMMAND_BUTTON_CLICKED,wxCommandEventHandler(MyFrame::CreateRecord));
}
void MyFrame::CreateRecord(wxCommandEvent &event)
{
Frame2->Destroy();
}
i only wanted to close the Frame2 not the parentFrame
how am i going to close only the Frame2