Solved

Wizards in MFC

Posted on 1998-11-06
7
513 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Installing Microsoft R server on REDHAT or SUSE Linux 4 136
sumDigits challenge 9 146
Prevent this page from creating additional dialogs. 3 507
Line meaning 9 85
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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…
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.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

816 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

11 Experts available now in Live!

Get 1:1 Help Now