When user assign a value to ClientHeight or ClientWidth of a form, the dimension of the form is automatically changed, then the OnResize event is triggered.
For example, the statement: Form1.ClientHeight:= 80
can run the code in routine TForm1.FormResize.
I find one case can mess up the running routine of the program, which traps the OnResize event. I want to control the proportion of a form, so I add this line in OnResize event:
This statement can trigger another resize event. The program also traps OnPaint event, and OnResize event usually triggers OnPaint event. It can run when the program is not so complex, but it is very possible to cause subtle problem in the future if the program becomes more complex.
How can I solve this problem?