使用PropSheetLook_OneNoteTabs样式动态调整CMFCPropertySheet的大小 [英] Dynamically resizing CMFCPropertySheet with PropSheetLook_OneNoteTabs style

查看:114
本文介绍了使用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,我可以先调整工作表的大小,然后再调整Tab控件的大小,然后再调整页面的大小,最后可以移动确定"/取消"/帮助"按钮.

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

推荐答案

只需按照此处所示的说明进行操作. 尽管说明适用于 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.

  1. 完全跳过 XmnPropSheetCallback DoModal 实现
  2. OnInitDialog中,只需调用CPropertySheet::OnInitDialog();,然后再调用OnSize,而不是执行该代码中提供的所有操作.
  1. Skip the XmnPropSheetCallback and DoModal implementations completely
  2. In OnInitDialog just make a call to CPropertySheet::OnInitDialog(); and then call OnSize instead of doing everything presented in that code.

这篇关于使用PropSheetLook_OneNoteTabs样式动态调整CMFCPropertySheet的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆