 |
|
 |
flicking when I drag the dialog.
|
|
|
|
 |
|
 |
Hi, this is a good article on Tab Control. I got some problem when I tried to use NTGraph as a control inside a CTabCtrl object. Basically inside the Tab control I have different kind of object. For example: For tab 1, I have NTGraph (Active X control); while for tab 2, I have List Control component. For the NTGraph control, I got it from: http://www.codeproject.com/KB/miscctrl/ntgraph_activex.aspx I am also using DlgResizeHelper class, available from: http://www.codeguru.com/cpp/w-d/dislog/resizabledialogs/article.php/c1913/ For some reason, I can't get the NTGraph Control resized properly (the other tab component, List Control, can be resized fine). I have also tried using NTGraph Control as a stand-alone (NOT as a component in the Tab Control) and I can resized it fine. To be more specific about the problem, using the DlgResizeHelper I should be able to resize all the components inside my dialog window. I am able to resize the TabCtrl, I am also able to resize the List Control (as an element in second Tab of my TabCtrl), however, I am NOT able to resize the NTGraph Control (as an element in the first Tab of my TabCtrl). It always gives me the original size of NTGraph Control. I just wonder if there is anyone out there who had experience similar to what I'm facing now or any idea that might enlighten me on this problem? Thanks and best regards, Willie
|
|
|
|
 |
|
 |
could you send the tab.exe file.
in the source, it doesnt have that file
plus there are two errors
c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\atlcore.h(111): error C3861: 'InitializeCriticalSectionAndSpinCount': identifier not found
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(23): fatal error C1189: #error : This file requires _WIN32_WINNT to be #defined at least to 0x0500. Value 0x0501 or higher is recommended.
any help appreciate
|
|
|
|
 |
|
 |
The code works but if you click OUTSIDE of the range of the tabs, the current tab no longer shows its' contents. However if you then click inside the current Tab, then it will reappear. Other than that this code seems to work nicely.
|
|
|
|
 |
|
 |
Destiny777 wrote: The code works but if you click OUTSIDE of the range of the tabs, the current
tab no longer shows its' contents. However if you then click inside
the current Tab, then it will reappear.
I have this same behavior when using nested tabs. Ever find a fix for this?
|
|
|
|
 |
|
 |
I finally gave up on using this code and went with something else that doesn't have the disappearing tabs. Don't recall where I found the code. Cannot seem to find the link to the page where I downloaded the workable code. The better code uses standard CTabCtrl controls via: #include "afxcmn.h" ...
|
|
|
|
 |
|
 |
Hi,
This is very good article and very helpful to everyone. But one problem in this article i.e, using this code, blinks the dialog when drag the dialog. How to avoid this blinking? Give me any suggestion?
Thanks & Regards,
Neeraja.
|
|
|
|
 |
|
 |
Nice article. Took this example to add to an existing test project where I need to edit configuration data for the program... want to allow changes without losing the ability to focus on the Main Form Dialog by using a Modal Form. My test project has at a main form that loads another form dialog non-modally then uses the example code to load 5 tabs. The Second Tab was the one that I wanted to be the Default Tab.. but alas, it wouldn't show the contents of the tab until I changed to a different tab then back to the Default Tab. Solved this minor issue by programatically moving the form 1 pixel in either the x or y direction then back... then Voila' the Default Tab showed up with the desired contents.
|
|
|
|
 |
|
 |
hi, I had tried your code. It's great.
One problem I had meet is that I used in a CFormView based split window. I put the initialization code in OnInitialUpdate(). When I run the code, the contents of the tab didn't show up. So, i add a OnShowWindow inside the OnInitialUpdate. The contents showed up, but located differently. Any help for this problem?
|
|
|
|
 |
|
 |
Hi
I had read tyour application its great , but i want to know how cani automatically change the order of tabctrl
i'll explain suppose i have 3 tabs in a dialog and all the 3 tabs have Some file search . After completion of Tab1 control automatically switch to Tab2 and the tab3
thanks
|
|
|
|
 |
|
 |
you can also mail at nitin_chauhan82@yahoo.com
|
|
|
|
 |
|
 |
Hi,
I am going to use your code in my project.
But, I couldn't find the license term.
License
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
Where is your license term?
please, reply me.
Thank you.
|
|
|
|
 |
|
 |
Hi
I do not have any terms for licencing. You can use as you want. But anyway
check the conditions of the codeproject. If there is no objections you have
full freedom to use it and do all the modifications you like.
Thanks for using my control. It all yours.
Sincerely,
Venura
VENURA GOONATILLAKE, SRI LANKA
|
|
|
|
 |
|
|
 |
|
 |
Hi,
You are mostly welcome. If you think it will suits for your requirement, get it and use it.
I really like it.
Sincerely,
Venura
VENURA GOONATILLAKE, SRI LANKA
|
|
|
|
 |
|
 |
Firstly, great control.. I have added new functionality to this control that i will post later on.
When using this control in Visual Studio 2005 i noticed that each page displayed a grey background instead of the new white tabbed interface.
First to make sure you have the new UI controls enabled comment out the #ifdef _UNICODE from the #pragma manifestdependency .. I dont know why the new UI controls only get enabled if you have a UNICODE project.
Now for the code additions.
Now on the CPropertyPage you want the white background for, you will need to overide the OnEraseBkgnd method, and add this code:
BOOL MyPropertyPage::OnEraseBkgnd(CDC* pDC)
{
// Get client area
CRect rc;
GetClientRect(&rc);
// Create grey brush and insert it into DC
CBrush brush(RGB(252,252,254));
CBrush* pOldBrush = pDC->SelectObject(&brush);
// Fill window with brush
pDC->PatBlt(rc.left, rc.top, rc.Width()-2, rc.Height(), PATCOPY);
// Restore DC
pDC->SelectObject(pOldBrush);
return TRUE;
}
If you run the above code you will get a nice white background but you may notice that all the controls still draw a grey background. For this you need to overide the OnCtlColor method on the property page also. Add this code:
HBRUSH MyPropertyPage::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CPropertyPage::OnCtlColor(pDC, pWnd, nCtlColor);
char Buffer[1024];
GetClassName(pWnd->GetSafeHwnd(), Buffer, 1024);
if (strcmp(Buffer, "Static") == 0 || strcmp(Buffer, "Button") == 0)
{
if (nCtlColor == CTLCOLOR_STATIC)
{
pDC->SetBkMode(TRANSPARENT);
return HBRUSH(m_HollowBrush);
}
}
return hbr;
}
Also in the class header you will also need to add the variable "m_HollowBrush" like so:
class MyPropertyPage: public CPropertyPage
{
DECLARE_DYNAMIC(MyPropertyPage)
CBrush m_HollowBrush;
...
}
.. and that should do the trick!
|
|
|
|
 |
|
 |
Hi dear Venura
I am using Visual Studio 2005 and specially VC++ MFC. It was really sweet and usefull, thank u and thank u
my email: ahmad_s_shojaeddin@hotmail.com
|
|
|
|
 |
|
 |
I have a dialog for which there is a TabInterface. I am however unable to see the tab control. What reasons might cause this?
Thanks,
Jeff
|
|
|
|
 |
|
 |
This may cause, because of wrong possitioning of your tab pages.
But I can't say exactly what the cause is, because of your brief description. If you can describe it detail I think I can help you
Thank You
Venura
VENURA GOONATILLAKE, SRI LANKA
|
|
|
|
 |
|
 |
Venura,
I have one question. When I click on the dialog holding the control unit to bring it into focus, I loose the contents of the dialog. Is there a means or a trick to prevent this from occurring?
Thanks,
Jeff
|
|
|
|
 |
|
 |
Help not needed. Found a solution. Thanks, Jeff
|
|
|
|
 |
|
 |
hi
I like to introduce my new tab control... this is much easier and
reliable. Now available in code project.
http://www.codeproject.com/useritems/Simple_Tab_Control.asp
Hope you will enjoy this...
Thank You
Venura
VENURA GOONATILLAKE, SRI LANKA
|
|
|
|
 |
|
 |
For setting right behaviour of embedded to tabCtrl dialogs author call CibTabCtrl::OnMove() in CDialog::OnMove(). This is wrong approach, becouse WM_MOVE send to window when it's must be minimized, this can be cause of that the window can't to restore. To avoid this you must call CibTabCtrl::OnMove() in CDialog::OnMoving() (WM_MOVING) instead OnMove()(WM_MOVE)
sorry for bad english
|
|
|
|
 |
|
 |
Hi alter gonzo
Yes you are correct. I am planning to submit the latest example which
do not carry those mistakes.
I am appreciating you comment.
Thank You
Venura
VENURA GOONATILLAKE, SRI LANKA
|
|
|
|
 |
|
 |
Hi there,
p1->Create(IDD_DIALOG_PAGE1,m_ctrlTAB.GetWindow(IDD_DIALOG_PAGE1));
???????????!!!!!!!!!!!
GetWindow is taking a uCmd that is one of a list of constants. It doesn't take the IDD. Tracing this, it always returns a NULL pointer to CWnd.
p1->Create(IDD_DIALOG_PAGE1,m_ctrlTAB.GetWindow(IDD_DIALOG_PAGE1));
is just equivilant to:
p1->Create(IDD_DIALOG_PAGE1);
but I am having a problem:
When I used p1->Create(IDD_DIALOG_PAGE1); my child window doesn't appear in the right place, it hided the buttons of the tab.
When I used p1->Create(IDD_DIALOG_PAGE1, this); (where this is pointer to the tab control object) my child dialog is in place but if i clicked inside it the dialog will hang.
Any idea about my problem?
What is the properties to set for the child dialog in resources? I made it "Style: Child", "Border: None", and "More Styles > Control: Checked".
Thanks
________________________________________
Dr. Smartee
badel@psd.com.eg
|
|
|
|
 |