8 个解决方案
#1
控件调用MoveWindow重新定位置
#2
To:louifox(兰陵笑笑生)
我的程序在向属性页(Tab页)加对话框时使用了MoveWindow,在xp下正常,为何在98下800*600或1024*768都不正常,要怎样做才可以,谢谢!
我的程序在向属性页(Tab页)加对话框时使用了MoveWindow,在xp下正常,为何在98下800*600或1024*768都不正常,要怎样做才可以,谢谢!
#3
能不能具体写几行代码?
#4
SetWindowPos也可以试试看
#5
http://www.vchelp.net/vchelp/type.asp?class_id=1&type_id=5
#6
void CLogToolDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// set window size
if(m_bOnSize)
{
GetDlgItem(IDC_FRAME_TOOLBAR)->MoveWindow(12, 0, cx - 30, 48, TRUE);
GetDlgItem(IDC_EDIT_SIG)->MoveWindow(12, 73, (cx-2)/2-12-30, cy-87, TRUE);
GetDlgItem(IDC_EDIT_LOG)->MoveWindow((cx-2)/2+30, 73, (cx-2)/2-12-30, cy-87, TRUE);
GetDlgItem(IDC_LABEL_LOG)->MoveWindow((cx-2)/2+30, 56, 81, 12, TRUE);
GetDlgItem(IDC_BTN_ANALY)->MoveWindow((cx-2)/2-26, (cy-48)/2, 52, 34, TRUE);
GetDlgItem(IDC_PROGRESS_ANALYSIS)->MoveWindow(cx/2-150, cy/2-15, 300, 30, TRUE);
}
m_bOnSize = true;
} // end of OnSize()
{
CDialog::OnSize(nType, cx, cy);
// set window size
if(m_bOnSize)
{
GetDlgItem(IDC_FRAME_TOOLBAR)->MoveWindow(12, 0, cx - 30, 48, TRUE);
GetDlgItem(IDC_EDIT_SIG)->MoveWindow(12, 73, (cx-2)/2-12-30, cy-87, TRUE);
GetDlgItem(IDC_EDIT_LOG)->MoveWindow((cx-2)/2+30, 73, (cx-2)/2-12-30, cy-87, TRUE);
GetDlgItem(IDC_LABEL_LOG)->MoveWindow((cx-2)/2+30, 56, 81, 12, TRUE);
GetDlgItem(IDC_BTN_ANALY)->MoveWindow((cx-2)/2-26, (cy-48)/2, 52, 34, TRUE);
GetDlgItem(IDC_PROGRESS_ANALYSIS)->MoveWindow(cx/2-150, cy/2-15, 300, 30, TRUE);
}
m_bOnSize = true;
} // end of OnSize()
#7
得到程序分辨率。根据屏幕分辨率来设置控件位置
movewindow
setwidowpos
都可以
movewindow
setwidowpos
都可以
#8
http://www.codeproject.com/dialog/easysize.asp
#1
控件调用MoveWindow重新定位置
#2
To:louifox(兰陵笑笑生)
我的程序在向属性页(Tab页)加对话框时使用了MoveWindow,在xp下正常,为何在98下800*600或1024*768都不正常,要怎样做才可以,谢谢!
我的程序在向属性页(Tab页)加对话框时使用了MoveWindow,在xp下正常,为何在98下800*600或1024*768都不正常,要怎样做才可以,谢谢!
#3
能不能具体写几行代码?
#4
SetWindowPos也可以试试看
#5
http://www.vchelp.net/vchelp/type.asp?class_id=1&type_id=5
#6
void CLogToolDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// set window size
if(m_bOnSize)
{
GetDlgItem(IDC_FRAME_TOOLBAR)->MoveWindow(12, 0, cx - 30, 48, TRUE);
GetDlgItem(IDC_EDIT_SIG)->MoveWindow(12, 73, (cx-2)/2-12-30, cy-87, TRUE);
GetDlgItem(IDC_EDIT_LOG)->MoveWindow((cx-2)/2+30, 73, (cx-2)/2-12-30, cy-87, TRUE);
GetDlgItem(IDC_LABEL_LOG)->MoveWindow((cx-2)/2+30, 56, 81, 12, TRUE);
GetDlgItem(IDC_BTN_ANALY)->MoveWindow((cx-2)/2-26, (cy-48)/2, 52, 34, TRUE);
GetDlgItem(IDC_PROGRESS_ANALYSIS)->MoveWindow(cx/2-150, cy/2-15, 300, 30, TRUE);
}
m_bOnSize = true;
} // end of OnSize()
{
CDialog::OnSize(nType, cx, cy);
// set window size
if(m_bOnSize)
{
GetDlgItem(IDC_FRAME_TOOLBAR)->MoveWindow(12, 0, cx - 30, 48, TRUE);
GetDlgItem(IDC_EDIT_SIG)->MoveWindow(12, 73, (cx-2)/2-12-30, cy-87, TRUE);
GetDlgItem(IDC_EDIT_LOG)->MoveWindow((cx-2)/2+30, 73, (cx-2)/2-12-30, cy-87, TRUE);
GetDlgItem(IDC_LABEL_LOG)->MoveWindow((cx-2)/2+30, 56, 81, 12, TRUE);
GetDlgItem(IDC_BTN_ANALY)->MoveWindow((cx-2)/2-26, (cy-48)/2, 52, 34, TRUE);
GetDlgItem(IDC_PROGRESS_ANALYSIS)->MoveWindow(cx/2-150, cy/2-15, 300, 30, TRUE);
}
m_bOnSize = true;
} // end of OnSize()
#7
得到程序分辨率。根据屏幕分辨率来设置控件位置
movewindow
setwidowpos
都可以
movewindow
setwidowpos
都可以
#8
http://www.codeproject.com/dialog/easysize.asp