user interface - How to use a CTabCtrl in a MFC dialog based application? -
i need expected simple - create tab control has 2 tabs, implying 2 modes of operation app. when user clicks on tab1, he'll presented buttons , textboxes, , when clicks tab2, other input method. noticed there ctabctrl class thats used in mfc add tabs. however, once added tab ctrl using ui designer, couldn't specify how many tabs there'll using property window. searching on net, found examples of them required derive ctabctrl , create 2 or more child dialogs etc , write own custom class. question is, since want basic, why couldn't using familiar add event handler/add member variable wizard , handle else inside app's class ? surely, default ctabctrl class can useful without needing derive ?
the mfc tab control pretty thin wrapper on win32 tab control, works in pretty way describe. window, provides switching between child windows using tabs. happens, in straight win32 useful way work. if want more sophisticated switching between individual windows, using child dialogs. mfc doesn't great deal you, deriving ctabctrl , using child dialogs not difficult do, although if you're used way winforms tab controls seem unnecessary.
if want tab control @ root of dialog, no other controls along side it, might want @ cpropertysheet (http://msdn.microsoft.com/en-us/library/d3fkt014(vs.80).aspx) simpler use. unless want use of wizard functionality don't need derive - create couple of child dialog classes, in place want create property sheet, make object, add pages , invoke it.
Comments
Post a Comment