[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1454
  • Last Modified:

Removing ok cancel apply button in property sheet

I have a property sheet which has two tabs derived from CPropertySheet.At the bottom of this dialog i have the default ok,cancel and apply button.I don't want these default buttons,but i want to use the page dialog button to control.How can it be done
0
gymsam
Asked:
gymsam
  • 3
  • 3
1 Solution
 
ShaunWildeCommented:
you can get rid of the apply button using PSH_NOAPPLYNOW see http://support.microsoft.com/support/kb/articles/Q141/0/39.asp

or in your OnCreate of you sheet you can use GetDlgItem/ShowWindow(FALSE);

eg for apply

CWnd* pApplyButton = GetDlgItem (ID_APPLY_NOW);
   ASSERT (pApplyButton);
   pApplyButton->ShowWindow (SW_HIDE);

the ID for OK and CANCEL are IDOK and IDCANCEL

0
 
ShaunWildeCommented:
by the way I assume you pages are CPropertyPage derived not CPropertySheet
0
 
DanRollinsCommented:
Hi ShaunWilde,  
Please don't lock questions.  Just post comments like everybody else.  Thanks!

Hi gymsam,
If you Create a modeless CPropertySheet, none of the buttons appear at the bottom.  Then in the propety pages, you can call the CPropertySheet::PressButton() to get the effect of pressing these buttons that are not available.

But what you propose is non-standard UI.  People expect to see [Close] and [OK] at the bottom of a property sheet.  Why do you want to confuse them?

Anyway, you will need to put OK and Cancel buttons on each property page or else people will get *really* confused.

-- Dan
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
gymsamAuthor Commented:
Yes DanRollins i will try your suggestion soon and get back to you.
0
 
ShaunWildeCommented:
> Please don't lock questions.  Just post comments like everybody else.  Thanks!

Hi Dan - actually since I thought it was an answer - then I am under the impression that it was okay to lock
0
 
gymsamAuthor Commented:
DanRollins
>But what you propose is non-standard UI.  People expect >to see [Close] and [OK] at the bottom of a property
>sheet.  Why do you want to confuse them?

What you say is right,but in my case i just display text in listbox of the page,the user can use x button on the top right conner of the window.

Mr.ShaunWilde comment is also right.So both of you are right.

0
 
gymsamAuthor Commented:
Since Mr.ShaunWilde's answered first i like to award him first.Thank you.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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