有关改变窗体大小的问题
void Cdlg::OnButton1()
{
// TOD Add your control notification handler code here
CString str;
if(GetDlgItemText(IDC_BUTTON1,str),str=="缩小")
{
SetDlgItemText(IDC_BUTTON1,"扩张");
}
else{
SetDlgItemText(IDC_BUTTON1,"缩小"); }
static CRect rectold;
static CRect rectnew;
CRect p;
GetWindowRect(&rectold);
GetDlgItem(IDC_PIC)->GetWindowRect(&p);
rectnew.top=rectold.top;
rectnew.left=rectold.left;
rectnew.right=rectold.right;
rectnew.bottom=p.bottom;
if(str=="缩小") { SetWindowPos(NULL,0,0,rectnew.Width(),rectnew.Height(),
SWP_NOMOVE|SWP_NOZORDER); }
else
SetWindowPos(NULL,0,0,rectold.Width(),rectold.Height(),
SWP_NOMOVE|SWP_NOZORDER);}
为什么按下缩小之后,再按就不扩大了那