0
votes

I need to close the current form dialog and open another form after the user clicks a button in an mfc application. Basically it is for my school project application. I have decided use mfc in visual c++ for my project and i have obsolutely no guidance regarding the language. I had chosen single document and CFormView class in mfc application wizard and used the resource editor to design two forms one of them is displayed at start of program and i need the other to open up and replace existing form. Had tried googling for an answer but couldn't understand anything. I have basic c++ oop knowledge but i am completely new to mfc. I use visual studio 2013 ultimate.

1

1 Answers

1
votes

You don't close current dialog truely, you can just hide it. So to do like this:

CCurrentDialig::OnBtnCliekted()
{
ShowWindow(this->m_hWnd, SW_HIDE);
COtherDialog dlg;
dlg.DoModal();
}