kkuu
asked on
Resize Control (for Answers2000)
Dear Answers2000,
I have used the method suggested by you to resize each component in the dialog before.
void CMyFormView::OnSize(UINT nType, int cx, int cy)
{
CFormView::OnSize(nType, cx, cy);
CRect rcClient;
GetClientRect(&rcClient);
CRect rcListCtrl;
m_list1.GetWindowRect(&rcL istCtrl); ScreenToClient((LPPOINT)(& rcListCtrl .left));
ScreenToClient((LPPOINT)(& rcListCtrl .right));
m_list1.MoveWindow(rcListC trl.left,r cListCtrl. top,rcClie nt.right-r cListCtrl. left-10,rc Client.bot tom-rcList Ctrl.top);
}
When I was running my application in debug mode, the assertion fail occured:
_AFXWIN_INLINE void CWnd::GetWindowRect(LPRECT lpRect) const
{ ASSERT(::IsWindow(m_hWnd)) ; ::GetWindowRect(m_hWnd, lpRect); }
But there is no problem in resizing the listCtrl in release mode. What is the reason about this?
Thanks!!!
I have used the method suggested by you to resize each component in the dialog before.
void CMyFormView::OnSize(UINT nType, int cx, int cy)
{
CFormView::OnSize(nType, cx, cy);
CRect rcClient;
GetClientRect(&rcClient);
CRect rcListCtrl;
m_list1.GetWindowRect(&rcL
ScreenToClient((LPPOINT)(&
m_list1.MoveWindow(rcListC
}
When I was running my application in debug mode, the assertion fail occured:
_AFXWIN_INLINE void CWnd::GetWindowRect(LPRECT
{ ASSERT(::IsWindow(m_hWnd))
But there is no problem in resizing the listCtrl in release mode. What is the reason about this?
Thanks!!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if(::IsWindow(m_list1.m_hW
Change to:
if(::IsWindow(m_list1.m_hW
{
[....]
}