V
VickyCool4U
Guest
Hi Experts,
I had developed a MFC based VC++(2010) application in MDI application.
I have two panels left side panel having tree control and right side panel having list ctrl.
The tree ctrl item selected details will be reflected in list control. i.e. in the right side panel.
But the left side panel which is having the tree ctrl is not displaying properly.
problem is highlighted in red color in the screenshot given as follows:-
One thing I noticed that if I minimize the CformView and restore it, the issue has been resolved.
So , it look like some paint issue.
So I created the following function:-
void CMyFormView::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM)dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
//dc.DrawIcon(x, y, m_hIcon);
}
else
{
CFormView::OnPaint();
}
}
Continue reading...
I had developed a MFC based VC++(2010) application in MDI application.
I have two panels left side panel having tree control and right side panel having list ctrl.
The tree ctrl item selected details will be reflected in list control. i.e. in the right side panel.
But the left side panel which is having the tree ctrl is not displaying properly.
problem is highlighted in red color in the screenshot given as follows:-
One thing I noticed that if I minimize the CformView and restore it, the issue has been resolved.
So , it look like some paint issue.
So I created the following function:-
void CMyFormView::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM)dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
//dc.DrawIcon(x, y, m_hIcon);
}
else
{
CFormView::OnPaint();
}
}
Continue reading...