Solved

Wizards in MFC

Posted on 1998-11-06
7
507 Views
Last Modified: 2013-11-20
I am creating one wizard like application using CPropertyPage and CPropertySheet classes from MFC.

Those gives me a dialog box with the HELP button
Because of this button (i think) i can´t place text, controls or whatever close to the right margin.

So my guess is that if i remove the help button from the template the dialog will be smaller ( without the big right margin) .

Two questions:
Am i thinking well?
How can i remove the help button?
0
Comment
Question by:jmartins71
  • 3
  • 2
  • 2
7 Comments
 
LVL 8

Accepted Solution

by:
Answers2000 earned 20 total points
ID: 1324297
To remove the help button, set the flag in the m_psh member of your property sheet, before calling DoModal :-

oMySheet.m_psh.dwFlags &= ~PSH_HASHELP ;

In my experience, the property sheet class still makes space for all the buttons even if you turn off buttons (you can turn off apply on non-wizard property sheets using - oMySheet.m_psh.dwFlags |= PSH_NOAPPLYNOW).  The property sheet is automatically sized to accommodate space for all potential buttons (including ones that might be turned off) or the largest property page - whichever is larger

To size your property sheet - do it like any other window - saying using SetWindowPos

There is are a couple of articles at this URL you might find useful
http://www.codeguru.com/propertysheet/index.shtml

"Resizing the Property Sheet - Zafir Anjum (1998/08/06) "
"Moving and Resizing the Property Pages - Zafir Anjum (1998/08/06)"
0
 

Author Comment

by:jmartins71
ID: 1324298
thanks Answers2000
0
 

Author Comment

by:jmartins71
ID: 1324299
"To remove the help button, set the flag in the m_psh member of your property sheet, before calling DoModal :-

oMySheet.m_psh.dwFlags &= ~PSH_HASHELP ; "

it does not work!

From codeguru, i have seen one similiar solution that affects one flag in each property page.
But even this solution does not hide the button. It simple disable it.
I also try with ShowWindow but the ID i use for the help button (i think is IDHELP) crush the application.

Could you give me more details of your solution?
 
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 8

Expert Comment

by:Answers2000
ID: 1324300
oops you're right, I misunderstood your question - sorry

I have done a bit of work with spy++

The help button is a child of the property sheet (not the property page) and has ID of 9

Therefore you should be able to use ShowWindow on it if you find it.

To find it from a property page (in a message handler for CPropertyPage derived class)

HWND hWndSheet = ::GetParent( this->m_hWnd ) ;
HWND hWndButton = ::GetDlgItem( hWndSheet, 9 ) ;

To find if from property sheet (in message handler for CPropertySheet derived class)

HWND hWndSheet = this->m_hWnd ;
HWND hWndButton = ::GetDlgItem( hWndSheet, 9 ) ;

Hide the button using
::ShowWindow( hWndButton, SW_HIDE ) ; /* SW_SHOW to show */

Disable button using EnableWindow
::EnableWindow( hWndButton, FALSE ) ; /* TRUE to enable */


0
 

Author Comment

by:jmartins71
ID: 1324301
It works just fine.
Thanks Answers2000.
Now i will try to resize it.
0
 
LVL 19

Expert Comment

by:mrwad99
ID: 14731069
>> void MyClass::f1(base&  b)//

changed to

>> void MyClass::f1(base*  b)//

Why the change there ?

Also, could this problem not be solved using double dispatch, or is that a different kettle of fish altogether ?

TIA
0
 
LVL 19

Expert Comment

by:mrwad99
ID: 14731073
LOL sorry, this comment was posted in the wrong question :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Replacement selected text 2 58
unable to delete all specified values regedit 38 277
Change owner from userA to server Local Administrators 7 59
string initialization in java 11 110
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. …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

910 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

22 Experts available now in Live!

Get 1:1 Help Now