用MoveWindow时候出现的奇怪的问题
我把其中的某些控件用MoveWindow重新确定了位置和大小,但只要一拉伸界面(对话框界面)或者最大化界面,某些从新确定位置的控件就又回到原来的位置,而另外一些就还固定在新位置上,这个是怎么回事呀?这些控件的属性完全一样,却有不同的情况发生,真是不明白,有没有高手帮帮我?
下面是我移动控件的源代码
void CSmartCDPlayerDlg::move_to_left(int move_x, int nID, bool isbig)
{
CString str;
static CRect RectButton;
GetWindowRect(&RectButton);
GetDlgItem(nID)->GetWindowRect(&RectButton);
ScreenToClient(&RectButton);//把屏幕坐标转化成用户坐标
static CRect f;
f.top=RectButton.top;
f.bottom =RectButton.bottom ;
f.left =RectButton.left ;
f.right =RectButton.right ;
if(isbig==FALSE) GetDlgItem(nID)->MoveWindow(f.left-move_x,f.top,f.right -f.left ,f.bottom -f.top );
else GetDlgItem(nID)->MoveWindow(f.left-move_x, f.top, f.right-f.left+move_x,f.bottom -f.top );
}