How to use a CTabCtrl in a MFC dialog based application ?

Posted by shan23 on Stack Overflow See other posts from Stack Overflow or by shan23
Published on 2010-04-27T05:08:05Z Indexed on 2010/04/27 5:13 UTC
Read the original article Hit count: 288

I need to do something which i expected to be was simple - create a tab control which has 2 tabs, implying 2 modes of operation for my app. When user clicks on Tab1, he'll be presented with some buttons and textboxes, and when he clicks Tab2, some other input method. I noticed that there was a CTabCtrl class thats used in MFC to add tabs. However, once I added the tab ctrl using the UI designer, I couldn't specify how many tabs there'll be using property window. Searching on the net, I found some examples but all of them required you to derive from CtabCtrl , create 2 or more child dialogs etc and to write your own custom class. My question is, since I want to do something so basic, why couldn't I do it using the familiar Add Event handler/Add member variable wizard and then handle everything else inside my app's class ? Surely, the default CTabCtrl class can do something useful without needing to derive from it ?

© Stack Overflow or respective owner

Related posts about mfc

Related posts about ctabctrl