user2157368
user2157368

Reputation: 1

How to avoid double scrollbars when using class CSplitterWndEx

I created an application with the MFC wizard and added the splitter functionality.

The wizard will add a variable CSplitterWndEx m_wndSplitter to class CChildFrame.

After that, a split view will be created with a horizontal scrollbar and a vertical scrollbar.

But the rich edit view also has its own scroll bar.

How can I keep only one scrollbar and keep the split functionality?

Thanks in advance.

Upvotes: 0

Views: 596

Answers (1)

Karthik Krish
Karthik Krish

Reputation: 131

The scroll bar is created with respected to the style given on creation of splitter window. Please refer the following link

https://learn.microsoft.com/en-us/cpp/mfc/reference/csplitterwnd-class?view=msvc-170#create

if the style is modified as below, the scrollbars will not be created

DWORD dwStyle = WS_CHILD | WS_VISIBLE | SPLS_DYNAMIC_SPLIT.

To show the Splitter for dynamic split, we need the scrollbars which creates space to display the splitter.

Upvotes: 0

Related Questions