Click here to Skip to main content
15,887,246 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: TabbedPane vs TabView Pin
Richard MacCutchan12-Mar-18 23:15
mveRichard MacCutchan12-Mar-18 23:15 
GeneralRe: TabbedPane vs TabView Pin
Sampath57912-Mar-18 23:17
Sampath57912-Mar-18 23:17 
GeneralRe: TabbedPane vs TabView Pin
Richard MacCutchan12-Mar-18 23:32
mveRichard MacCutchan12-Mar-18 23:32 
GeneralRe: TabbedPane vs TabView Pin
Sampath57912-Mar-18 23:44
Sampath57912-Mar-18 23:44 
GeneralRe: TabbedPane vs TabView Pin
Richard MacCutchan12-Mar-18 23:53
mveRichard MacCutchan12-Mar-18 23:53 
GeneralRe: TabbedPane vs TabView Pin
Sampath57912-Mar-18 23:59
Sampath57912-Mar-18 23:59 
GeneralRe: TabbedPane vs TabView Pin
Victor Nijegorodov13-Mar-18 1:25
Victor Nijegorodov13-Mar-18 1:25 
GeneralRe: TabbedPane vs TabView Pin
Sampath57913-Mar-18 6:14
Sampath57913-Mar-18 6:14 
ok. How can it solve my problem.

class MyMainClass : public CScrollView
{
   int OnCreate(LPCREATESTRUCT lpCreateStruct);
}

int MyMainClass::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CScrollView::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	//CRect rect;
	//GetWindowRect(rect);
	if (!tab.Create(CMFCTabCtrl::STYLE_FLAT, CRect(0,0,100,100), this, 1))
	{
		TRACE0("Failed to create output tab window\n");
		return -1;      // fail to create
	}
	tab.AddTab(this, _T("tab1"),101);
	tab.AddTab(this, _T("tab1"),102);
	// TODO:  Add your specialized creation code here

	return 0;
}


Above piece of code created a tabcontrol with 2 tabs on it. But with out some view on this window how can i render some thing.

sorry if i miss anything to create view. Do i need to inherit my class from CMFCtabCtrl or is it ok even if i inherit from CScrollView?

Also when i select the second tab, my application is getting hanged. What could be the reason?

Edit 2:
I have gone through some examples and understood that, "this" in below call created issues.

tab.AddTab(this, _T("tab1"),101)


instead of this, we need to provide the control we are going to add to that tab control. For eg;
CEdit edit;
we need to give &edit instead of this. I saw this in microsoft samples.

This also does not solve my problem. In case if i have 3 tabs, then i need to create 3 CViews and add them to tabcontrol. Again this is like kind of creating new view for each tab.

But i want only one view and different tabs.

modified 13-Mar-18 13:32pm.

GeneralRe: TabbedPane vs TabView Pin
Victor Nijegorodov13-Mar-18 9:29
Victor Nijegorodov13-Mar-18 9:29 
GeneralRe: TabbedPane vs TabView Pin
Sampath57913-Mar-18 17:59
Sampath57913-Mar-18 17:59 
GeneralRe: TabbedPane vs TabView Pin
Sampath57913-Mar-18 19:05
Sampath57913-Mar-18 19:05 
GeneralRe: TabbedPane vs TabView Pin
Sampath57913-Mar-18 23:39
Sampath57913-Mar-18 23:39 
GeneralRe: TabbedPane vs TabView Pin
Sampath57913-Mar-18 23:44
Sampath57913-Mar-18 23:44 
GeneralRe: TabbedPane vs TabView Pin
Sampath57914-Mar-18 3:51
Sampath57914-Mar-18 3:51 
GeneralRe: TabbedPane vs TabView Pin
Victor Nijegorodov14-Mar-18 10:26
Victor Nijegorodov14-Mar-18 10:26 
QuestionHow to change color of Tab View in MFC Pin
Sampath57910-Mar-18 2:55
Sampath57910-Mar-18 2:55 
AnswerRe: How to change color of Tab View in MFC Pin
Victor Nijegorodov10-Mar-18 7:35
Victor Nijegorodov10-Mar-18 7:35 
GeneralRe: How to change color of Tab View in MFC Pin
Sampath57910-Mar-18 18:17
Sampath57910-Mar-18 18:17 
GeneralRe: How to change color of Tab View in MFC Pin
Victor Nijegorodov10-Mar-18 21:52
Victor Nijegorodov10-Mar-18 21:52 
GeneralRe: How to change color of Tab View in MFC Pin
Sampath57910-Mar-18 23:11
Sampath57910-Mar-18 23:11 
GeneralRe: How to change color of Tab View in MFC Pin
Victor Nijegorodov10-Mar-18 23:18
Victor Nijegorodov10-Mar-18 23:18 
QuestionWhy the arrow button on TabControl is not working in my MFC application. Pin
Sampath57910-Mar-18 2:54
Sampath57910-Mar-18 2:54 
QuestionError while using static int for incremental record. Pin
Tarun Jha10-Mar-18 0:02
Tarun Jha10-Mar-18 0:02 
AnswerRe: Error while using static int for incremental record. Pin
Richard MacCutchan10-Mar-18 1:09
mveRichard MacCutchan10-Mar-18 1:09 
GeneralRe: Error while using static int for incremental record. Pin
Tarun Jha10-Mar-18 1:44
Tarun Jha10-Mar-18 1:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.