Solved

Removing Cancel Button from CPropertySheet

Posted on 2004-04-25
12
365 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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
 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

823 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