Solved

CPropertySheet and context sensitive help

Posted on 1997-08-07
7
279 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Adapt this command to show who installed 29 111
Separate into files by filename 12 87
Unix Command -- Challenging  question 7 96
Way to decrease size of apk file 9 86
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

839 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