Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - activating tabs in CXTPTabControl
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

activating tabs in CXTPTabControl

 Post Reply Post Reply
Author
Message
nadia View Drop Down
Newbie
Newbie


Joined: 15 February 2007
Location: United States
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote nadia Quote  Post ReplyReply Direct Link To This Post Topic: activating tabs in CXTPTabControl
    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-
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.063 seconds.