hi, i got a dialog,
and i already checked the boxes "Minimize box" and "Maximize box" in the styles tab under the Dialog Properties.
so, the minimize and maximize icons do appear in the right up corner of the dialog.
however, after clicking the maximize icon. only the dialog is maximised, the contents within the dialog ( a clistctrl and some buttons) still remain the same size and same position.
then, i added the following funtion to the dialog class:
void CReadDBDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
GetDlgItem(IDC_ListControl)->SetWindowPos(NULL,0,0,cx -5, cy -5,
SWP_NOMOVE | SWP_NOZORDER);
GetDlgItem(IDC_BUTTON_PRINT)->SetWindowPos(NULL,0,0,cx -5, cy -5,
SWP_NOMOVE | SWP_NOZORDER);
GetDlgItem(IDC_READ)->SetWindowPos(NULL,0,0,cx -5, cy -5,
SWP_NOMOVE | SWP_NOZORDER);
GetDlgItem(IDC_Query)->SetWindowPos(NULL,0,0,cx -5, cy -5,
SWP_NOMOVE | SWP_NOZORDER);
GetDlgItem(IDC_INSERT)->SetWindowPos(NULL,0,0,cx -5, cy -5,
SWP_NOMOVE | SWP_NOZORDER);
GetDlgItem(IDC_DELETE)->SetWindowPos(NULL,0,0,cx -5, cy -5,
SWP_NOMOVE | SWP_NOZORDER);
GetDlgItem(IDC_BUTTONSCAN)->SetWindowPos(NULL,0,0,cx -5, cy -5,
SWP_NOMOVE | SWP_NOZORDER);
GetDlgItem(IDOK)->SetWindowPos(NULL,0,0,cx -5, cy -5,
SWP_NOMOVE | SWP_NOZORDER);
}
then, when execute it, it gave an assertion error.
saying something
ASSERT
:IsWindow(m_hWnd)
.....
anybody could tell me what's wrong here?
Thanks a lot in advance
kaya
and i already checked the boxes "Minimize box" and "Maximize box" in the styles tab under the Dialog Properties.
so, the minimize and maximize icons do appear in the right up corner of the dialog.
however, after clicking the maximize icon. only the dialog is maximised, the contents within the dialog ( a clistctrl and some buttons) still remain the same size and same position.
then, i added the following funtion to the dialog class:
void CReadDBDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
GetDlgItem(IDC_ListControl)->SetWindowPos(NULL,0,0,cx -5, cy -5,
SWP_NOMOVE | SWP_NOZORDER);
GetDlgItem(IDC_BUTTON_PRINT)->SetWindowPos(NULL,0,0,cx -5, cy -5,
SWP_NOMOVE | SWP_NOZORDER);
GetDlgItem(IDC_READ)->SetWindowPos(NULL,0,0,cx -5, cy -5,
SWP_NOMOVE | SWP_NOZORDER);
GetDlgItem(IDC_Query)->SetWindowPos(NULL,0,0,cx -5, cy -5,
SWP_NOMOVE | SWP_NOZORDER);
GetDlgItem(IDC_INSERT)->SetWindowPos(NULL,0,0,cx -5, cy -5,
SWP_NOMOVE | SWP_NOZORDER);
GetDlgItem(IDC_DELETE)->SetWindowPos(NULL,0,0,cx -5, cy -5,
SWP_NOMOVE | SWP_NOZORDER);
GetDlgItem(IDC_BUTTONSCAN)->SetWindowPos(NULL,0,0,cx -5, cy -5,
SWP_NOMOVE | SWP_NOZORDER);
GetDlgItem(IDOK)->SetWindowPos(NULL,0,0,cx -5, cy -5,
SWP_NOMOVE | SWP_NOZORDER);
}
then, when execute it, it gave an assertion error.
saying something
ASSERT
.....
anybody could tell me what's wrong here?
Thanks a lot in advance
kaya