Solved

how to set property sheet's title in the bottom

Posted on 2000-03-15
4
263 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
set up trigger (or something) to rename files (starting with ATL) in a linux directory 6 54
Define unique primary key 9 94
fix34  challenge 9 125
Not needed 13 114
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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.

825 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