Reputation: 155
I have an MFC applicaton, but now i need to add new features using tab control(so my main program dialog become "tab 1"). But there is a problem I see - when using tabs, you must create new application and then add tabs as dialogs. So it means I need to rewrite all the event handlers for buttons and all variables i used in my project. Is there a way to migrate to tabcontrol application without doing so much job again?
Upvotes: 1
Views: 1046
Reputation: 4337
I think you don't need to rewrite the event handlers. I used the CMFCTabCtrl class and all event handlers still continue to be inside the forms they were.
It is very practical, as unlike the old CTabCtrl, you do not need to make code to hide/show elements when switching tabs. You just have to pass a CWnd* typed variable when you do AddTab(), and that variable could be ... your form.
Upvotes: 1