By experiment I found that Resize event is fired when Move is performed. Not only that, but Move action also preserves resize factors (so literally Move=Resize). In practice it means, when the form is being Moved (i.e. by user), and if another thread resizes it through BeginInvoke, it will get its original size (the one it had before movement started) when the next Move event happens.
Business use case/example: user opens a screen with dynamically sized ListBox, which contains dynamic list of items, whose population may take considerable time. Assuming loading takes place in a parallel thread and then BeginInvoke is called to update DataSource. When DataSource is updated, form size should change to accommodate all items on screen, if possible (if not, pagination will occur). With default approach, size update will have no effect if user was moving the form across the screen (to another screen would be best example) when the list finished loading, as it would automatically revert to original size.
Question: is it possible to somehow override Move or Resize behavior to consume that new size and not revert to the original one? Should I look into WndProc hacking?
Not sure if my answer would be useful 3 months late, but I got around this by handling the
Form.ResizeBeginandForm.ResizeEndevents. These are called respectively whenever the user starts and stops dragging around the form on the screen.In ResizeBegin event handler
In the method called by BeginInvoke:
In ResizeEnd event handler: