• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 384
  • Last Modified:

Removing Cancel Button from CPropertySheet

Hi,

I wanted to remove Cancel Button from CPropertySheet

Please explain how to do this
thanks
sudha
0
sudhakar_koundinya
Asked:
sudhakar_koundinya
  • 7
  • 4
2 Solutions
 
AndyAinscowFreelance programmer / ConsultantCommented:
Try
GetDlgItem(IDCANCEL)->ShowWindow(SW_HIDE);
to hide it.
0
 
sudhakar_koundinyaAuthor Commented:
i already did that  and application raised assertion failure
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
I did a small app, added a property sheet and put that in the OnInitDialog of the PropSheet.  No ASSERT, no CANCEL button.
0
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.

 
ZoppoCommented:
> i already did that  and application raised assertion failure
What AndyAinscow suggested is correct, but you have to do it after the propertysheet is created, so, as AndyAinscow stated
a good place to do is the poperty sheet's OnInitDialog ... therefor you'll have to derive your own class from CPropertySheet,
add a OnInitDialog handler (ie. via ClassWizard) and add the given line of code after base class call to CPropertySheet::OnInitDialog
is done ...


hope that helps,

ZOPPO
0
 
sudhakar_koundinyaAuthor Commented:
I did like this

//      (sht.GetDlgItem (IDCANCEL))->ShowWindow(SW_HIDE);
0
 
sudhakar_koundinyaAuthor Commented:
and it wasn't worked
0
 
sudhakar_koundinyaAuthor Commented:
OOPS

It worked now
I did it after creation of PropertySheet as Modal . Very Silly Mistake

Thanks
for pointing the problem
0
 
sudhakar_koundinyaAuthor Commented:
AndyAinscow

Although you have commented the right thing, Zoppo pointed the problem.


May I Split the points equally for both you guys :-)
0
 
sudhakar_koundinyaAuthor Commented:
>>after creation

It was before calling the DoModal()

Compulsorily should raise assertion problems. Very Nasty Mistake
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
In general a window doesn't exist until it is created.   For dialog/property sheet it is created as part of the DoModal or for modeless in the Create call.  Actually a property sheet doesn't even create the pages until they are actually required.
0
 
sudhakar_koundinyaAuthor Commented:
Yeah, It was very Silly and Nasty Mistake I done

Although you have commented the right thing, Zoppo pointed the problem.


May I Split the points equally for both you guys :-)
 
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
Split if you think appropriate
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

  • 7
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now