Print Page | Close Window

CXTPTabControl Dynamic Window

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=4000
Printed Date: 10 November 2025 at 9:53am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPTabControl Dynamic Window
Posted By: cgaskill
Subject: CXTPTabControl Dynamic Window
Date Posted: 13 April 2006 at 7:29pm

I have a project that will create a tab for each DLL that is associated to it.  I create the tab via InsertItem but leave the hwndClient parameter as NULL.  Then when the user clicks on a tab I want to load the DLL library, create the window, and so it to the user.  I can load the library, create the window, and associate the new window to the specific tab via the SetHandle method on the CXTPTabManagerItem class.  However, the SetSelectedItem method of CXTPTabControl gets the child window via (GetHandle) before it notifies the parent that the user selected a new tab.  So the tab doesn't show the window.  Since the m_hwndClient variable of CXTPTabControl is only set in the SetSelectedItem method there is no way to set this other than clicking on another tab then clicking back to see the window.  Not what we want the user to have to do.  Since the variable m_hwndClient is private I can't subclass CXTPTabControl to provide my own implementation for the virtual method SetSelectedItem.  My work around is after I have created the new window I call SetSelectedItem(NULL), then SetSelectedItem(pTabItem) (where pTabItem as retrieve from a previous call to GetSelectedItem) to force it to draw properly.

Is this the only way to accomplish this or am I missing something?




Replies:
Posted By: Oleg
Date Posted: 13 April 2006 at 7:59pm

hi,

SetSelectedItem is virtual method, you can just override it and set handle before paret class call.



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: cgaskill
Date Posted: 14 April 2006 at 8:31am
I tried that.  I was going to send the notification that the selection had changed first (which would allow the parent to call the SetHandle with the new window) then set the internal variable m_hwndClient as it currently does; however, the hwndClient variable is private so I can't access it.



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