문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top