Click here to Skip to main content
13,055,852 members (48,239 online)
Rate this:
Please Sign up or sign in to vote.
See more: , +
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 17:45pm
Rate this: bad
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.
Rate this: bad
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.

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 | Mobile
Web02 | 2.8.170713.1 | Last Updated 17 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