display wrong value


I am new to xojo. When using r4.0, I do not seems to encounter this problem. After upgraded to r4.1, this problem seems to arise intermittently.

When opening the web app, the button is set to reposition within the rectangle at run time. Please refer to this screen shot:-

Sometimes, when I start the web app or refresh the web app browser, it does not reposition itself with the rectangle box. Please refer to this screen shot:-

I had placed the codes in the Shown Event Handlers
Button1.Top = Rectangle1.Top
Button1.Left = Rectangle1.Left

I also realized that ocassionally, I am getting 0 value for Rectangle1.Top which should not be the case. You may download the sample project from dropbox link:

May someone advise why I am getting this inconsistence value (Rectangle1.Top)?

Thank you in advance.


I think a better solution to make sure that buttons (and other controls) stay inside an rectangular area is to use a container control instead of an rectangle.

An example project with container control…

Hello Christian Mzes,

Thanks for your great effort to send me the example container control project. I think that is what I am looking for. :slight_smile: