Click here to Skip to main content
13,139,515 members (51,128 online)
Rate this:
Please Sign up or sign in to vote.
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..
Posted 5-Oct-10 19:04pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170915.1 | Last Updated 6 Oct 2010
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