cformview wm_size [英] cformview wm_size

查看:96
本文介绍了cformview wm_size的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我在mdi窗口的拆分器窗口中使用cformview(mfc)类.formview上有一些控件,并且每当formview类的大小更改时,我都试图调整控件的大小.当应用程序启动时,formview类正在获取wm_size消息三遍.第一次和第三次,我认为我得到了错误的大小值.由于这是第一次,我的控件未正确布置.
为什么我三遍收到wm_size消息?
请向我解释哪里出了问题.

Hi all,
I am using cformview(mfc) class in a splitter window of a mdi window.formview has some controls on it and i an trying to resize the controls whenever the size of formview class is changing.when the application is started formview class is getting wm_size message for three times.first time and third time i think i am getting wrong size values.due to this at the very first time my controles are not arranged properly.
Why i am getting the wm_size message three times?
Please explain me where will be the wrong.

推荐答案

已经有一段时间了,因为我使用了CFormView ,但是我认为MFC会创建视图,然后适合调整到框架,然后调整框架本身的大小时,它将再次调整视图的大小.您可以尝试使用其他方法,例如处理包含框架的窗口的WM_SIZE ,或等待窗口激活消息(忘记确切的消息),然后再处理WM_SIZE 消息.

顺便说一句,您可能想在代码项目中查看Paolo Messina出色的ResizableLib库:

ResizableLib [
It''s been a while since I used a CFormView but I reckon MFC creates the view, then fits it to the frame, and when the frame itself resizes, it resizes the view again. You could try alternatives like handling the WM_SIZE of the containing frame window, or waiting for a window activate message (forgot the exact message) and only then handling the WM_SIZE messages.

BTW you might want to look at Paolo Messina''s excellent ResizableLib library here on Code Project:

ResizableLib[^]

It includes a class called CResizableFormView which will do what you want.


这篇关于cformview wm_size的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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