Print Page | Close Window

ReportControl scrollbars draw problem

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=23276
Printed Date: 02 May 2024 at 5:28pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: ReportControl scrollbars draw problem
Posted By: mihey
Subject: ReportControl scrollbars draw problem
Date Posted: 01 March 2017 at 8:40am
Hi everyone,

I'm having a problem with CXTPReportControl scrollbars used inside of CXTPResizePropertySheet page.

By any reason scrollbars are not drawn properly if I switch between pages.

See on the screenshot:



It looks like a typical re-draw problem. If I do a resize or move columns, everything appears correct with scrollbars.

I've tried to workaround the problem using AdjustScrollBars() or RedrawControl() methods inside of Page::OnSetActive() handler but without any success .

Does anyone have any idea or a suggestion?

Best regards,
Mikhail

XTP 17.3 MFC VC++7.1 (2003), Win7 x64



Replies:
Posted By: mihey
Date Posted: 01 March 2017 at 9:32am
Hi,

I just found out, that the problem has something to do with SetThemextpReportThemeOffice2013 theme.

For me it looks now like a bug. It even can be reproduced with ReportDialog sample in XTP 17.3.

You only have to add some more records and call
m_wndReportCtrl.SetTheme(xtpReportThemeOffice2013, TRUE);

after all. You'll see that the scrollbar is missing.


Best regards,
Mikhail


Posted By: mihey
Date Posted: 30 March 2017 at 8:10am
Hi,

a workaround for the problem at the moment is to do not use WS_EX_STATICEDGE style for the control, but I'm not very satisfied with it.

Best regards,
Mikhail


Posted By: olebed
Date Posted: 07 April 2017 at 10:01am
Hello Mihey,

Problem in method CXTPReportThemeOffice2013::DrawWindowFrame()
I can advice to using SetScrollInfo() to update scrollBars
void CXTPReportThemeOffice2013::DrawWindowFrame(CDC* pDC, CRect rcWindow)
{
    if (::IsWindow(m_pControl->GetSafeHwnd()))
    {
        if (m_pControl->GetExStyle() & WS_EX_STATICEDGE)
        {
            pDC->Draw3dRect(rcWindow, m_clrBtnFace, m_clrBtnFace);
            
            SCROLLINFO  si;
            si.cbSize = sizeof(SCROLLINFO);
            m_pControl->GetScrollInfo(SB_VERT, &si, SIF_ALL);
            m_pControl->SetScrollInfo(SB_VERT, &si); // Note: Causes an OnSize message
            m_pControl->GetScrollInfo(SB_HORZ, &si, SIF_ALL);
            m_pControl->SetScrollInfo(SB_HORZ, &si); // Note: Causes an OnSize message
        }
        else
        {
            CXTPReportPaintManager::DrawWindowFrame(pDC, rcWindow);
        }
    }
}

Regards,
 Oleksandr Lebed



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net