Print Page | Close Window

CXTTabCtrl and CXTResizeFormView

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=2549
Printed Date: 08 November 2025 at 1:40pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTTabCtrl and CXTResizeFormView
Posted By: Martin
Subject: CXTTabCtrl and CXTResizeFormView
Date Posted: 08 July 2005 at 5:31am

Hello,

I have a couple of problems and general questions:

1. When creating tabs with the CXTTabCtrl and using the method AddView with CXTResizeFormView the last added tab is also the active tab. I want to make the first tab the active tab.

I tried this but it has a painting problem in my formview:

CWnd *pView = m_Tab.GetView(RUNTIME_CLASS(MyFormView));
if (pView){
m_Tab.ActivateView(pView);
m_Tab.SetCurSel(0); // Needed because somehow ActivateView doesn't change the tab index

::SetWindowPos(m_Tab.m_hWnd, NULL, 0,0,0,0, SWP_NOMOVE|SWP_NOSIZE|SWP_FRAMECHANGED);
m_Tab.Invalidate(FALSE);

}

Q: How can I set the first tab as active one AND make sure the tab gets painted correctly?

2. When I create a new dialog based on CFormView I can edit the properties of my dialogs, e.g. create a variable for a textbox of the type CEdit. When I subclass the dialog to use CXTResizeFormView instead of CFormView I cannot do this anymore.

Q: How can I somehow let the VIsual Studio know that CXTResizeFormView is in fact derived from CFormView so I can use the normal dialog handling? Now I have to first change all references to CXTResizeFormView back to CFormView before I can edit the variables.

Now some general questions:

1. Can I also use the method as outlined above to get a pointer to a view in the tabcontrol to access member variables and functions if I typecast them to my own formview class?

2. When I add a formview to my tabcontrol the dialog is created "sunken" which makes a rather terrible effect. How do I get rid of that "sunken" effect so the formview appears more as a part of the tabcontrol?

T.I.A,

Martin




Replies:
Posted By: Martin
Date Posted: 11 July 2005 at 4:46am

I somehow don't have the paint problem anymore when using the code outlined above. So hopefully this one is solved.

The other problems remain unfortunately.... (I am particularly interested in answers to these questions):

1. How can I somehow let the Visual Studio know that CXTResizeFormView is in fact derived from CFormView so I can use the normal dialog handling? Now I have to first change all references to CXTResizeFormView back to CFormView before I can edit the variables.

2. When I add a formview to my tabcontrol the dialog is created "sunken" which makes a rather terrible effect. How do I get rid of that "sunken" effect so the formview appears more as a part of the tabcontrol (and as a normal tab)?

Any help is greatly appreciated.

Thanks,
Martin



Posted By: Martin
Date Posted: 11 July 2005 at 6:49am

And to answer one of my questions myself (I asked it too soon, because I didn;t test it myself yet):

You can use this code to access the members of the formview:

CMyFormView *pView = (CMyFormView*)m_Tab.GetView(RUNTIME_CLASS(CMyFormView));

pView now holds a pointer to all the available members in the CMyFormView class.

Hope this is helpful to anyone.

 

 

 

 




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