![]() |
CXTPTabControl Dynamic Window |
Post Reply
|
| Author | |
cgaskill
Newbie
Joined: 13 April 2006 Location: United States Status: Offline Points: 15 |
Post Options
Thanks(0)
Quote Reply
Topic: CXTPTabControl Dynamic WindowPosted: 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? |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
cgaskill
Newbie
Joined: 13 April 2006 Location: United States Status: Offline Points: 15 |
Post Options
Thanks(0)
Quote Reply
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.
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |