Solved

Removing Cancel Button from CPropertySheet

Posted on 2004-04-25
12
363 Views
Last Modified: 2013-11-20
Hi,

I wanted to remove Cancel Button from CPropertySheet

Please explain how to do this
thanks
sudha
0
Comment
Question by:sudhakar_koundinya
  • 7
  • 4
12 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 10916160
Try
GetDlgItem(IDCANCEL)->ShowWindow(SW_HIDE);
to hide it.
0
 
LVL 14

Author Comment

by:sudhakar_koundinya
ID: 10917298
i already did that  and application raised assertion failure
0
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 25 total points
ID: 10917381
I did a small app, added a property sheet and put that in the OnInitDialog of the PropSheet.  No ASSERT, no CANCEL button.
0
 
LVL 31

Assisted Solution

by:Zoppo
Zoppo earned 25 total points
ID: 10917529
> 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
 
LVL 14

Author Comment

by:sudhakar_koundinya
ID: 10917749
I did like this

//      (sht.GetDlgItem (IDCANCEL))->ShowWindow(SW_HIDE);
0
 
LVL 14

Author Comment

by:sudhakar_koundinya
ID: 10917755
and it wasn't worked
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.

 
LVL 14

Author Comment

by:sudhakar_koundinya
ID: 10917773
OOPS

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

Thanks
for pointing the problem
0
 
LVL 14

Author Comment

by:sudhakar_koundinya
ID: 10917793
AndyAinscow

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


May I Split the points equally for both you guys :-)
0
 
LVL 14

Author Comment

by:sudhakar_koundinya
ID: 10917804
>>after creation

It was before calling the DoModal()

Compulsorily should raise assertion problems. Very Nasty Mistake
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 10918294
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
 
LVL 14

Author Comment

by:sudhakar_koundinya
ID: 10925035
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
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 10925748
Split if you think appropriate
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
Decoding 32 bit binary streams 6 37
FizzBuzz challenge 9 77
mapBully challenge 6 115
Annoying "thing" blocks my view 4 83
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…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

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

27 Experts available now in Live!

Get 1:1 Help Now