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