Solved

Wizards in MFC

Posted on 1998-11-06
7
529 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MFC Dialog 9 53
ASCII Non-Printable characters/codes and their HTML equivalents 6 143
JQuery serialize and unserialize 8 199
Problem to App source 6 93
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…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.

726 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