MFC中,我在初始化函数中对一个对话框隐藏了一部分,怎样通过点击一个按钮还原
隐藏代码如下:if(GetDlgItemText(IDC_CONTRACT,str),"扩展>>"==str){SetDlgItemText(IDC_CONTRACT,"...
隐藏代码如下:
if(GetDlgItemText(IDC_CONTRACT,str),"扩展>>"==str)
{
SetDlgItemText(IDC_CONTRACT,"收缩<<");
}
else
{
SetDlgItemText(IDC_CONTRACT,"扩展>>");
}
CRect rectLarge;
CRect rectSmall;
CRect rectLeft;
GetWindowRect(&rectLarge);
GetDlgItem(IDC_LEFT)->GetWindowRect(&rectLeft);
rectSmall.left=rectLarge.left;
rectSmall.top=rectLarge.top;
rectSmall.right=rectLarge.right;
rectSmall.bottom=rectLeft.bottom;
if("收缩<<"==str)
{
SetWindowPos(NULL,0,0,rectLarge.Width(),rectLarge.Height(),
SWP_NOMOVE | SWP_NOZORDER);
}
else
{
SetWindowPos(NULL,0,0,rectSmall.Width(),rectSmall.Height(),
SWP_NOMOVE | SWP_NOZORDER);
}
return TRUE; // return TRUE unless you set the focus to a control
}
void CCalculator1Dlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
} 展开
if(GetDlgItemText(IDC_CONTRACT,str),"扩展>>"==str)
{
SetDlgItemText(IDC_CONTRACT,"收缩<<");
}
else
{
SetDlgItemText(IDC_CONTRACT,"扩展>>");
}
CRect rectLarge;
CRect rectSmall;
CRect rectLeft;
GetWindowRect(&rectLarge);
GetDlgItem(IDC_LEFT)->GetWindowRect(&rectLeft);
rectSmall.left=rectLarge.left;
rectSmall.top=rectLarge.top;
rectSmall.right=rectLarge.right;
rectSmall.bottom=rectLeft.bottom;
if("收缩<<"==str)
{
SetWindowPos(NULL,0,0,rectLarge.Width(),rectLarge.Height(),
SWP_NOMOVE | SWP_NOZORDER);
}
else
{
SetWindowPos(NULL,0,0,rectSmall.Width(),rectSmall.Height(),
SWP_NOMOVE | SWP_NOZORDER);
}
return TRUE; // return TRUE unless you set the focus to a control
}
void CCalculator1Dlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询