Solved

CPropertySheet and context sensitive help

Posted on 1997-08-07
7
276 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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

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…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 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

9 Experts available now in Live!

Get 1:1 Help Now