Solved

CPropertySheet and context sensitive help

Posted on 1997-08-07
7
277 Views
Last Modified: 2013-11-19
I would like to have context sensitive help in a CPropertySheet, like Word have in its options dialog.
I would like the help button to away, and instead get the little question mark in the caption of the property sheet. How do I do that?
0
Comment
Question by:roar
  • 3
  • 3
7 Comments
 
LVL 1

Accepted Solution

by:
cnasarre earned 90 total points
ID: 1303291
Have you tried to OR PSP_HASHELP to the style
in the wizard constructor ?

CHardwareWizard::CHardwareWizard(CWnd* pWndParent)
   : CWizSheet(IDS_SHEET_HARDWAREITEM, pWndParent)
{
// it is a wizard !
   SetWizardMode();

// add an help button
   m_psh.dwFlags |= PSP_HASHELP;
}

0
 

Expert Comment

by:Amaresh080997
ID: 1303292
Hi roar!
 I have a suggestion.As I understand, you want to put a small "question mark" at the right top of the "PROPERTY SHEET".right? Well! PLease try the following..
1) Derive a class say "CPropSheet" from CPropertySheet as the base class.
2)Go to your "PropSheet.cpp" and add the function "OnInitDialog".
3) Call "ModifyStyleEx" function.
4) Include this "PropSheet.h" at the relevant place

I am giving the sample code below..

//The following code should go whereever u wnat to display the //property sheet

#include "PropSheet.h"
#include "MyPropPage.h"

void CMyClass::Display()
{
 CPropSheet propsheet("Sheet");
 CMyPropPage Mypage;
 propsheet.AddPage(&Mypage);
 propsheet.DoModal();// I am assuming u want to create a modal                      //sheet.If u are interested in a modeless                      //one, call "Create()" with suitable                      //arguements.
}

// The following code should go to the "PropSheet.h" file

void CPropSheet::OnInitDialog()
{
  ModifyStyleEx(0,WS_EX_CONTEXTHELP ,0);
  return CPropertySheet::OnInitDialog();
}

This will put the "?" mark on the right top.Then you have to create help IDs and map them to take the relevant help text from the .rtf file.I hope u r familiar with that.Good luck!!
Try the above solution and let me know if it works.

By the way cnasarre! I am not sure about your solution but I think the PSP_HASHELP has some thing to do with the "Help" button but not the "Question Mark" on the right top to get context sensitive help.
0
 

Author Comment

by:roar
ID: 1303293
It worked fine Amaresh. Thanks.
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.

 

Expert Comment

by:Amaresh080997
ID: 1303294
Hi roar!
   Thanks for your reply.Did you try my method?Which method did you use?Nice to know you got it working.
Bye.
Amaresh
0
 

Author Comment

by:roar
ID: 1303295
I made a base class CBasePropSheet, with a OnInitDialog as shown in your example, and derived all other property sheets from that one.
I think you're right when you say that PSP_HASHELP controls the help button, and not the little question mark in the caption.
Moreover, the PSP_HASHELP mentioned by cnasarre should only be used on a property page, not a property sheet. There is a style PSH_HASHELP to be used with a property sheet.
0
 

Expert Comment

by:Amaresh080997
ID: 1303296
Hi roar!
   Thanks for your reply.I was just curious to know the way you got it finally.By the way, will I get some points?:-):-):-)
bye
Amaresh
0
 

Author Comment

by:roar
ID: 1303297
Hi amaresh, do you want points? If you answer Q.8630015329, you'll get them. (The little question mark in the caption don't come when it is a wizard)
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
Need to retreive data from .TFS file exported by DVR 8 180
ASCII Non-Printable characters/codes and their HTML equivalents 6 106
sumHeights2  challenge 7 89
wordcount challenge 11 110
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 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