[Original] cpropertysheet usage tips
Author: lixiaosan
Date: 04/13/2006
The article is constantly being updated... Click here
Preface:
In fact, some people have already introduced cpropertysheet.
Reference
Http://www.codeguru.com/Cpp/controls/propertysheet/article.php/c3973/
In this article, the author introduces the following application skills:
1. Hide and move standard buttons (OK, cancel, apply, help)
2. Change the text content of the tab label.
3. Change the text font of the tab label.
4. Use image on the tab label
5. Put a bitmap on the property sheet
6. add controls on the property sheet
7. Add a header to the top of the property sheet
8. Response standard button
There are examples provided by MFC. We suggest you download them and study them by yourself.
Visual c ++ MFC Samples
Propdlg sample: demonstrates property sheet support
Http://msdn.microsoft.com/library/default.asp? Url =/library/en-US/vcsample/html/_ sample_mfc_propdlg.asp
In this article, I will introduce some features and usage issues that are not mentioned below.
(Basically, there are ready-made implementations on the Internet, so paste the URL ..)
1. Create a non-modal cpropertysheet and implement the standard button response (the non-modal cpropertysheet does not have any buttons by default)
Q146916:
How to Create a modeless cpropertysheet with standard buttons
Http://support.microsoft.com/kb/146916/en-us
2. Hide the Apply button (the implementation in the preface link is also included in the introduction to the following link)
Q141039:
Howto: how to hide the Apply button in cpropertysheet
Http://support.microsoft.com/kb/141039/en-us
3. A non-modal cpropertysheet is a dialog box or a subcontrol of cpropertysheet. when the focus is switched, the application will not respond.
Bool cmysheet: oninitdialog ()
{
Modifystyleex (0, ws_ex_controlparent); // Add this sentence
Return cpropertysheet: oninitdialog ();
}
For more information, see:
Q149501: PRB: Child cpropertysheet hangs if focus is switched
Http://support.microsoft.com/kb/149501/en-us
4. Change the cpropertypage size during running
Q143291:
How to resize cpropertypages at run time in Visual C ++
Http://support.microsoft.com/kb/143291/en-us
5. The "0xc0000005: access violation" error is displayed when you call domodal or create of cpropertysheet.
Q158552:
You receive a "0xc0000005: access violation" error message when you call the cpropertysheet: domodal method or the create method in Visual C ++
Http://support.microsoft.com/kb/158552/en-us
6. Set the default button for cpropertysheet
Q140587: HOWTO: How to change default button on cpropertysheet
Http://support.microsoft.com/kb/140587/en-us
7. Disable Tab
Q151662:
Howto: how to disable tabs in cpropertysheet
Http://support.microsoft.com/kb/151662/en-us
Disable tab changes tab to gray at the same time
Http://www.codeguru.com/cpp/controls/propertysheet/article.php/c549/
Http://www.microsoft.com/msj/0398/c0398.aspx
8. Change the text content of the tab label (the implementation in the preface link is also included in the introduction of the following link)
Q141487:
Howto: how to change the text in the tabs of A cpropertysheet
Http://support.microsoft.com/kb/141487/en-us
9. Add the Help button context help button to the title bar of cpropertysheet.
Q244232:
How to add context help button (? Button) to title bar of cpropertysheet
Http://support.microsoft.com/kb/244232/en-us
10. Use scrollbar for tab labels
Cpropertysheet calls enablestackedtabs (false) before domodal or create );
11. Change the font of cpropertypage
Q142170:
Prpfont.exe sample demonstrates how to set the desired font for your cpropertypages in Visual C ++
Http://support.microsoft.com/kb/142170/en-us
12. Change the text color of the Selected tab
Q206626:
How to change the text color of the selected property Sheet tab in Visual C ++
Http://support.microsoft.com/kb/206626/en-us
13. cpropertysheet that can be changed
Q300606:
How to implement a resizable property sheet class that contains a menu bar in Visual C ++ 6.0
Http://support.microsoft.com/kb/300606/en-us
14. Change the default focus of the control on cpropertypage.
Q148388:
Howto: How to change default control focus on cpropertypage
Http://support.microsoft.com/kb/148388/en-us
15. In the wizard-style cpropertysheet, both back/next button and finish button are displayed.
By default, finish is under next and is hidden. So if you want to display them at the same time, you need to show finish and move next.
Q143210:
Howto: how to add the finish button to a wizard property sheet
Http://support.microsoft.com/kb/143210/en-us
16. Implement HELP button message response
Q132715:
Howto: how to enable the Help button on a modal property sheet
Http://support.microsoft.com/kb/132715/en-us
17. Add a shortcut for cpropertysheet
Q142384:
Howto: How to Create accelerators for cpropertypages
Http://support.microsoft.com/kb/142384/en-us
18. Implementation of the wizard97 style Attribute Table
Http://www.codeproject.com/property/conquering_wizard97.asp