如何在MFC中动态更改对话框中元素的位置? [英] How to change the position of elements in dialog dynamically in mfc?
本文介绍了如何在MFC中动态更改对话框中元素的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在基于对话框的Mfc中更改静态元素的位置和大小?
我现在通过拖放操作有一个CStatic框,我想更改代码中该元素的位置和大小.我该怎么办?
How to change the position and size of static element in dialog based Mfc?
I have a CStatic box by drag and drop now I want to change the position and size of that element in the code. How can I do this?
CStatic *pWnd= (CStatic *)GetDlgItem(IDC_STATIC_PICTURE); //Id of CStatic Control
pWnd->GetClientRect(rcRect);
pWnd->ClientToScreen(rcRect);
我得到了rcRect,但是如何设置新的rect值是用来设置新的rect值的函数.
I got rcRect but how to set the new rect value what is the function used to set new rect values.
推荐答案
我猜想GetClientRect和MoveWindow会帮助您.
看这个链接. [^ ]
I guess GetClientRect and MoveWindow Will help you on that.
Look at this link. [^]
这篇关于如何在MFC中动态更改对话框中元素的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文