Click here to Skip to main content
11,484,752 members (64,186 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MFC
Hi,
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 20:04pm

1 solution

Rate this: bad
good
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.
  Permalink  
Comments
reshmi2000 at 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
0 Maciej Los 190
1 Sergey Alexandrovich Kryukov 180
2 Raje_ 155
3 OriginalGriff 147
4 Mehdi Gholam 120
0 Sergey Alexandrovich Kryukov 8,494
1 OriginalGriff 7,948
2 Sascha Lefèvre 3,199
3 Maciej Los 2,681
4 Richard Deeming 2,370


Advertise | Privacy | Mobile
Web04 | 2.8.150520.1 | Last Updated 6 Oct 2010
Copyright © CodeProject, 1999-2015
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