Forum > LCL

Distinguish between a form resize through code and a user-initiated resize

<< < (3/3)

440bx:
disclaimer: I haven't tried this but, at least in Windows, it should "operate" like this.

When a window is being _manually_ resized, the following is true: the mouse is captured, there has been one or more mouse move messages received and lastly the left mouse button is down.   None of those is likely true when the resizing is done programatically.

The above said, it is possible to have a timer resizing the window _while_ a user is manually resizing the window.  The fact that this is possible indicates that the determination is difficult to do accurately (it can be done by tracking the mouse movement.)

Bottom line is: setting a flag when a button causes the resizing is a good idea but, it is not conclusive because the resizing of the window can take place manually and programmatically simultaneously. 

Anyway... I thought I'd give some food for thought to those attempting to provide a solution.

Navigation

[0] Message Index

[*] Previous page

Go to full version