调用函数取决于窗口大小 [英] Calling a function depends on window size chnages

查看:85
本文介绍了调用函数取决于窗口大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要在更改窗口大小(ez:拖动或最小化或最大化)时实现功能需要调用具有更新窗口宽度()的函数。

如果有任何功能,请你帮助我打电话取决于窗户大小的变化。

vc ++ mfc



我尝试过:



目前获取当前窗口大小宽度并在那里绘制一些文本但是在更改窗口大小时文本正在移动到其他位置(因为宽度正在更新)

解决方案

您需要回复 WM_SIZE [ ^ ]和 WM_MOVE [ ^ ]消息。


< blockquote>覆盖 CWnd :: OnSize [ ^ ]。

need to implement a functionality while changing window size (ez:dragging or minimizing or maximizing) need to call function with updated window width().
could you please help me if any function is there to call depends on window size changes.
vc++ mfc

What I have tried:

currently getting current window size width and drawing some text there but while changing window size the text is moving to some other place(because width is updating)

解决方案

You need to respond to the WM_SIZE[^] and WM_MOVE[^] messages.


Override CWnd::OnSize[^] of your window class.


这篇关于调用函数取决于窗口大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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