Print Page | Close Window

CXTTabCtrl SetCurSel issues

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: General Discussion
Forum Description: Topics Related to Visual C++ MFC Development in General
URL: http://forum.codejock.com/forum_posts.asp?TID=10276
Printed Date: 30 January 2025 at 9:26pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTTabCtrl SetCurSel issues
Posted By: nktsrw
Subject: CXTTabCtrl SetCurSel issues
Date Posted: 17 April 2008 at 10:51am
Hi,

I have a subclassed CXTTabCtrl, but adding three controls (dialogs) to the tab control and selecting the first one with SetCurSel(0) doesn't work correctly: it selects the first tab but the content is the last control added.
Instead using SetActiveView(0) it works fine.

Am I doing something wrong? this is a code snippet:

void MyTab::PreSubclassWindow()
{
     CXTTabCtrl::PreSubclassWindow();
     this->_Dialog1.Create(IDD_DIALOG1);
     this->_Dialog2.Create(IDD_DIALOG2);
     this->_Dialog3.Create(IDD_DIALOG3);

     this->AddControl(_T("Dialog1"), &(this->_Dialog1),0);
     this->AddControl(_T("Dialog2"), &(this->_Dialog2), 1);
     this->AddControl(_T("Dialog3"), &(this->_Dialog3), 2);

     //this->SetCurSel(0);
     this->SetActiveView(0);
}



Thanks,
Seb



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net