Click here to Skip to main content
15,941,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a dialog application, which has got resizing. My requirement is to increase the font and column width of list control when the window size increases,and decrease the font and column width when the window size is reduced.

How can i get the current window position and compare whether the size is increased or decreased from previous size? I tried GetWindowRect() in the OnSizing() handler. But i was not able to resize the list control.
Please help me someone..

1 solution

The OnSizing() event is fired when the user is still in the process of sizing the Window.

At this point GetWindowRect() it is most likely that windows pos is the original placement, so this wouldn't work for you.

Also the OnSizing() has a LPRECT parameter that contains the windows coordinates while size, so this could be used to achieve what you want.

Finally you may what to switch to the OnSize() event this will be fired when the user has finished sizing the window and you are free to re-adjust your controls and GetWindowRect() and GetClientRect() will be correct.
Share this answer
reshmi2000 7-Oct-10 3:40am    
Thanks Rhuros.. Its working now.

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