Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I am using cformview(mfc) class in a splitter window of a mdi window.formview has some controls on it and i an trying to resize the controls whenever the size of formview class is changing.when the application is started formview class is getting wm_size message for three times.first time and third time i think i am getting wrong size values.due to this at the very first time my controles are not arranged properly.
Why i am getting the wm_size message three times?
Please explain me where will be the wrong.

1 solution

It's been a while since I used a CFormView but I reckon MFC creates the view, then fits it to the frame, and when the frame itself resizes, it resizes the view again. You could try alternatives like handling the WM_SIZE of the containing frame window, or waiting for a window activate message (forgot the exact message) and only then handling the WM_SIZE messages.

BTW you might want to look at Paolo Messina's excellent ResizableLib library here on Code Project:

ResizableLib[^]

It includes a class called CResizableFormView which will do what you want.
 
Share this answer
 
v2

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