问个小问题
我做个按钮,按下收缩或扩展,怎么不行啊!能通过编译,但不能执行还出现这错误:。exe遇到问题需要关闭,我们对此引起的不便表示抱歉。我是新手也不知道出了什么回事。请帮忙解决。谢谢
谢谢!!!!!!
代码:void CTsetDlg::OnButton2()
{
// TODO: Add your control notification handler code here
CString str;
if(GetDlgItemText(IDC_BUTTON2,str),str=="收缩<<")
{SetDlgItemText(IDC_BUTTON2,"扩展>>");
}
else
{SetDlgItemText(IDC_BUTTON2,"收缩<<");
}
static CRect rectLarge;
static CRect rectSmall;
if(rectLarge.IsRectNull ())
{CRect rectSparator;
GetWindowRect(&rectLarge);
GetDlgItem(IDC_SEPARATOR)->GetWindowRect(&rectSparator);
rectSmall.left =rectLarge.left ;
rectSmall.right =rectLarge.right ;
rectSmall.bottom =rectLarge.bottom ;
rectSmall.top =rectLarge.top ;
}
if(str==" 收缩<<")
{SetWindowPos(NULL,0,0,rectSmall.Width() ,rectSmall.Height() ,SWP_NOMOVE|SWP_NOZORDER);
}
else
{SetWindowPos(NULL,0,0,rectLarge.Width() ,rectLarge.Height (),SWP_NOMOVE|SWP_NOZORDER);
}
}
谢谢帮忙!!!!!!