Question

I am trying to hide my scrollbars in Mainframe windows so that all views will not display the vertical and horizontal bars. Here is the code.

void CMainFrame::OnPaint()
{
  CPaintDC dc(this); // device context for painting
  // TODO: Add your message handler code here
  // Do not call CFrameWndEx::OnPaint() for painting messages
  ShowScrollBar(SB_BOTH, FALSE);
#pragma comment(lib, "UxTheme.lib")
 if (IsThemeActive()) ::SetWindowTheme(*this, NULL, _T("Scrollbar"));
}

I cannot make this work. Any suggestions?

Était-ce utile?

La solution

The problem lies in the child view CView. Somehow, the MFC default creates PreCreateWindow function and implements horizontal and vertical scroll bars. I did not notice the problem before I posted the question.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top