Click here to Skip to main content
13,140,231 members (47,836 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hello CP users,
I want to override CSplitterWnd
Here is what I did:
class CMySplitter : public CSplitterWnd
		m_cxSplitter = m_cySplitter = 4;
		m_cxBorderShare = m_cyBorderShare = 0;
		m_cxSplitterGap = m_cySplitterGap = 4;
		m_cxBorder = m_cyBorder = 2;

I have did many testing manipulating these member variables, & I found that:
m_cxSplitter should be >= (m_cxBorder * 2)
m_cySplitter should be >= (m_cyBorder * 2)
Or-else the application will crash when the user try to resize the splitter window.
I am really confused why is this !
And the main frame border rectangle of the splitter window will not be painted correctly (Invalidated) if the m_cxBorder > 2 or m_cyBorder > 2

Can any body help me to make this last repaint correctly when the user try to resize the splitter window.

Thank you for your understanding.
Posted 25-Jun-13 8:55am
JackDingler 25-Jun-13 16:03pm
Don't use values that cause crashes or produce painting artifacts.

If you want to use values that the Microsoft Developers didn't write supporting code for, then you may have to enhance the CSplitterWnd class. Microsoft provides source code for the MFC library so that you may create your own custom versions of the MFC classes.
The_Inventor 26-Jun-13 5:33am
Make it a variable within the WM_RESIZE message handler. Then you can make the splitter any size you want, and it will resize correctly. Oh, and m_cxBorderShare = m_cyBorderShare = 2;
Jonathan Davies 26-Jun-13 6:04am
Presumably the m_cxSplitter includes the width of the borders and as you have 1 border on each side it has to be at least equal to m_cxBorder x 2. Same for Y.
tomay3000 27-Jun-13 13:00pm
Good thinking

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170915.1 | Last Updated 25 Jun 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100