Print Page | Close Window

activating tabs in CXTPTabControl

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=6434
Printed Date: 05 May 2025 at 2:37am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: activating tabs in CXTPTabControl
Posted By: nadia
Subject: activating tabs in CXTPTabControl
Date Posted: 15 February 2007 at 3:46pm

I have a dialog attached to an XTPDockingPane.

On the dialog I have several custom buttons (derived from MFC CButton) and a CXTPTabControl with corresponding dialog views (one for each button). Each view in the tab control has a number of edit controls.

Clicking each custom button brings a particular tab to view. The tabs can also be selected/clicked directly from the tab control for editing.

 

The problem is as follows:

If I select any tab directly, it brings up the particular view and the cursor is placed in the first edit box on the view. However, if I click the custom button, the particular tab is selected and brought to view OK, but it does not place the cursor to the edit box (unless I click the tab directly).

 

There is OnClicked() message handler in my custom button class that posts a message to the parent dialog to select specified tab (TabControl->SetCurSel(index);)

 

I also tried to call TabControl->SetFocus(); TabControl->SetSelectedItem(pItem); TabControl->OnItemClick(pItem); even pItem->Select() and pItem-> SetVisible(); but nothing seems to programmatically set the focus to the correct spot (unless I manually click the tab)...

 

This worked OK when I used MFC CTabCtrl class which makes me believe there is something up with CXTPTabControl…

 

Any suggestions?



-------------
-------------
-Nadia-



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