سؤال

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