Such as: I have a ListBox with a id IDC_CTCI_MSG in the mainframe; how can I resize its size and position when I change the size of window? I know that it can be done in OnSize, but I do not how to do it.
Could you tell me the details about it?
void CLogToolDlg::OnSize(UINT nType, int cx, int cy) { CDialog::OnSize(nType, cx, cy);
I know that it can be done in OnSize, but I do not how to do it.
{
CDialog::OnSize(nType, cx, cy);
// set window size
if(m_bOnSize)
{
GetDlgItem(IDC_FRAME_TOOLBAR)->MoveWindow(12, 0, cx - 30, 48, TRUE);
}
m_bOnSize = true;
} /
Onset..名字不记得了这个函数,大概这样,你去MSDN查
這個就是改変control的大小和位置
CWnd *pwnd;
CRect rect; pwnd=(CWnd *)GetDlgItem(IDC_RICHEDIT);
if(pwnd==NULL)return;
pwnd->GetWindowRect(&rect);
ScreenToClient(&rect);
rect.left=cx-20-200;
rect.right=cx-20;
rect.bottom=cy-50;
pwnd->MoveWindow(&rect,TRUE);