为什么不能达到预期目标?(帮看代码)
void CTEXTDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
CWnd *pClist = GetDlgItem(IDC_LIST1);
CWnd *pOK = GetDlgItem(IDOK);
CWnd *pCel = GetDlgItem(IDCANCEL);
if(pClist)
{
m_List.MoveWindow(CRect(0,0,cx/8*7,cy-5),TRUE);
TRACE("cx = %d,cy = %d\n",cx,cy);
}
if(pOK)
{
m_Ok.MoveWindow(CRect(cx/8*7+5,50,cy-5,80),TRUE);
}
if(pCel)
{
pCel->MoveWindow(CRect(cx/8*7+5,90,cy-5,120),TRUE);
}
}
问题点数:50、回复次数:6Top
1 楼kingcom_xu(冷羽)回复于 2002-12-08 14:44:19 得分 0
得确保这些窗口已经生成Top
2 楼bin127(温柔一刀)回复于 2002-12-08 14:49:45 得分 0
启动时是有一个列表框和二个按纽的,一旦改变了大小之后那二个按纽就不见了?Top
3 楼kingcom_xu(冷羽)回复于 2002-12-08 14:56:57 得分 20
第三个参数怎么是cy-5????Top
4 楼ccwing(不是背书郎)回复于 2002-12-08 14:59:08 得分 30
好像这样就看得见了
void CTEXTDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
CWnd *pClist = GetDlgItem(IDC_LIST1);
CWnd *pOK = GetDlgItem(IDOK);
CWnd *pCel = GetDlgItem(IDCANCEL);
if(pClist)
{
m_List.MoveWindow(CRect(0,0,cx/8*7,cy-5),TRUE);
TRACE("cx = %d,cy = %d\n",cx,cy);
}
if(pOK)
{
m_Ok.MoveWindow(CRect(cx/8*7+5,50,cx-5,80),TRUE);
}
if(pCel)
{
pCel->MoveWindow(CRect(cx/8*7+5,90,cx-5,120),TRUE);
}
}
Top
5 楼ccwing(不是背书郎)回复于 2002-12-08 14:59:52 得分 0
void CTEXTDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
CWnd *pClist = GetDlgItem(IDC_LIST1);
CWnd *pOK = GetDlgItem(IDOK);
CWnd *pCel = GetDlgItem(IDCANCEL);
if(pClist)
{
m_List.MoveWindow(CRect(0,0,cx/8*7,cy-5),TRUE);
TRACE("cx = %d,cy = %d\n",cx,cy);
}
if(pOK)
{
m_Ok.MoveWindow(CRect(cx/8*7+5,50,cx-5,80),TRUE);
***
}
if(pCel)
{
pCel->MoveWindow(CRect(cx/8*7+5,90,cy-5,120),TRUE);
}
}
Top
6 楼bin127(温柔一刀)回复于 2002-12-08 15:12:07 得分 0
感谢,结账Top




