Dynamically resizing CMFCPropertySheet with PropSheetLook_OneNoteTabs style(使用 PropSheetLook_OneNoteTabs 样式动态调整 CMFCPropertySheet 的大小)
问题描述
我正在尝试动态调整 CMFCPropertySheet
的大小以在每个页面的底部添加自定义控件.
I'm trying to resize dynamically a CMFCPropertySheet
to add a custom control at the bottom of each page.
由于所有属性页的高度不同,我有一种机制可以在必要时增加大小.为此,我重写了 OnActivatePage
方法,通过使用 SetWindowPos
,我可以调整工作表的大小,首先是选项卡控件,然后是页面,最后我可以移动确定/取消/帮助按钮.
As all Property Pages are not of the same height, I have a mechanism to increase the size if necessary.
For this, I have overridden the OnActivatePage
method and by using SetWindowPos
, I can resize the sheet, first, then the tab control, then the page and finally I can move the OK/Cancel/Help buttons.
它适用于 PropSheetLook_OutlookBar
和 PropSheetLook_Tabs
样式,但不适用于 PropSheetLook_OneNoteTabs
样式.页面(或选项卡)未正确调整大小(页面的浅灰色未填满工作表.
It works fine with PropSheetLook_OutlookBar
and PropSheetLook_Tabs
styles but not with PropSheetLook_OneNoteTabs
style. The page (or the tab) is not correctly resized (the lighter grey color of the page does not fill the sheet.
OneNote 风格 OneNote http://www.freeimagehosting.net/uploads/th.ec91600664.jpg
OneNote style OneNote http://www.freeimagehosting.net/uploads/th.ec91600664.jpg
Outlook 风格 Outlook http://www.freeimagehosting.net/uploads/th.319b6938ab.jpg
Outlook style Outlook http://www.freeimagehosting.net/uploads/th.319b6938ab.jpg
有什么想法吗?MFC 功能包错误?
Any idea? A MFC Feature Pack bug?
推荐答案
只需按照 here 中的说明进行操作.尽管这些说明适用于 CPropertySheet,但它们也适用于 CMFCPropertySheet.
Just follow the instructions as seen in here. Although the instructions are for CPropertySheet they work for the CMFCPropertySheet as well.
部分代码已弃用,因此您需要进行以下修改.
Some parts of the code is deprecated so you will need to make the following amendments.
- 完全跳过 XmnPropSheetCallback 和 DoModal 实现
- 在
OnInitDialog
中只需调用CPropertySheet::OnInitDialog();
然后调用OnSize
而不是执行该代码中的所有操作.
- Skip the XmnPropSheetCallback and DoModal implementations completely
- In
OnInitDialog
just make a call toCPropertySheet::OnInitDialog();
and then callOnSize
instead of doing everything presented in that code.
这篇关于使用 PropSheetLook_OneNoteTabs 样式动态调整 CMFCPropertySheet 的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 PropSheetLook_OneNoteTabs 样式动态调整 CMFCPropertySheet 的大小


基础教程推荐
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
- 我有静态或动态 boost 库吗? 2021-01-01
- 常量变量在标题中不起作用 2021-01-01
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- 这个宏可以转换成函数吗? 2022-01-01
- C++结构和函数声明。为什么它不能编译? 2022-11-07