?
Solved

Wizards in MFC

Posted on 1998-11-06
7
Medium Priority
?
552 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 80 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
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 
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

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

762 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