Click here to Skip to main content
15,868,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

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.
 
Share this answer
 
Thanks for the link Brydon!
I'll try and understand the article and try and incorporate it.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900