How to run code on Resize window?

Hi,

I need to run some code when user resize window. What trigger should i use (except on timer…)?

Hi Valentin

There is no OnResize or a similarly trigger in Navision. I am afraid that your only option is to use the OnTimer trigger.

Regards

Claus

Hi Val,

I don’t think there is a trigger as such, but its pretty easy to do anyway.

Create a form.
Add a Table box.
Create a function that returns the hight (or wdth) of the form, and returns that vaue as an integer.
Add a control to the table box, that uses the new funtion as the source control
Set the Glue for the Table box as both on width and height.
Now add code tot he new function to do what you want.

Basically what you are doing is putting a control in a table box, when the box resizes (thats why it must be glue both) it triggers the function to get the hight, and in there you just add you code.

Actually its easier if I just upload an example.

Here is the sample…

Code to check if a user resizes a Form.