0
votes

In one MFC application there is a paned window. On that window,

I have added a menu-bar and a toolbar and lots of other controls. The paned window is re-sizable.

Now for the re-sizable window, I have override the function OnSize(). There I have retrieved the top window size and then below it and so on... Then for every control I have retrieved it's window and called MoveWindow().

I just wants to be assured is it the correct way for handling resizable window/ dialog in MFC or there is some other ways available.

Thanks

2

2 Answers

0
votes

Instead of reinventing the wheel: try the ResizableLib. It can handle resizing of dialogs in a very easy way and you don't have to worry about every detail yourself.

0
votes

When moving a large number of controls at once, it is preferable to use DeferWindowPos to minimize the repainting. I have an example of how to use it for a resizable MFC dialog at https://stackoverflow.com/a/5739620/5987.