Solved

CPropertySheet and context sensitive help

Posted on 1997-08-07
7
278 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
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.

 

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

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
Decoding 32 bit binary streams 6 42
Rewrite URL With Encoded Characters 6 78
Question regarding Copy/Paste 16 96
Adapt this command to show who installed 29 108
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…
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 Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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.

776 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