Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ Windows Win32 MFC , +
I'm working on a mfc application, where there is a main dialog with several custom controls on it.
I have two custom controls, one below the other.
I want to add a horizontal splitter bar between them, such that when moved down, the top control increases in size(i.e. in length) and the bottom control decreses in size(i.e. length) and vice versa.
 
I'm confused about the logic I should apply. When the splitter bar is moved, how do I change the top and bottom controls accordingly? Should I re-draw them with the new dimensions?(But isn't redrawing for every move of the splitter inefficient and may lead to flickering?) Or is there a way to just increase/decrease the length.
I also came across DefWindowProc. Can it be used in this case?
 
Thanks a lot for the help!!
Posted 16-Jun-13 18:45pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

The MFC splitter was written for use with their view classes. A recent CP article provides a dialog splitter class here[^] with examples on how to use it.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Thanks for the link Brydon!
I'll try and understand the article and try and incorporate it.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 7,903
1 Sergey Alexandrovich Kryukov 7,142
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,820


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 17 Jun 2013
Copyright © CodeProject, 1999-2014
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