Solved

how to set property sheet's title in the bottom

Posted on 2000-03-15
4
244 Views
Last Modified: 2013-11-20
I meet a problem, when I am using VC++6, I want to set my propertysheet's title in the bottom of propertysheet( like vc++ ide's classview, resource view, itc.)
I don't want to use CTabCtrl, then create Dialog as its child control.  
0
Comment
Question by:zhangguangcheng
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
cdepetris earned 100 total points
ID: 2622425
Derive a class from CPropertySheet using class wizard, then add a handler for OnInitDialog and change the code to

BOOL YourPropSheet::OnInitDialog()
{
CWnd* pWnd = GetDlgItem(AFX_IDC_TAB_CONTROL);
ASSERT(pWnd);
if (pWnd)
pWnd->ModifyStyle(0, TCS_BOTTOM);
return CPropertySheet::OnInitDialog();
}

Then use YourPropSheet in place of CpropertySheet

HTH,
Chris
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 2624165
CTabCtrl* pTab = GetTabControl()

is probably better than the GetDlgItem(AFX_IDC_TAB_CONTROL) method (which is not officially documented)

Another way is to subclass the tab contorl, then you can take more control of it (eg. use owner-draw for colouring tabs.


0
 

Author Comment

by:zhangguangcheng
ID: 2627044
yes, this is right, but I have already resolve the problem by myself.
First time I do it look like yours, but I found problem on painting. so I ask questions on the expert-exchange.
but I add the setactivepage(0), it can resolve it. and you haven't this one.
my ways to it:

BOOL CMyPropSheet::OnInitDialog()
{
CPropertySheet::OnInitDialog();
      
CTabCtrl* tab= GetTabControl();                                                          
DWORD dwStyle=::GetWindowLong(tab->m_hWnd,GWL_STYLE);
SetWindowLong(tab->m_hWnd,GWL_STYLE,dwStyle|TCS_BOTTOM);
SetActivePage(0);

}


0
 
LVL 1

Expert Comment

by:cdepetris
ID: 2628284
The painting problem can be resolved by calling the base class after SetWindowLong.

Chris
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now