[Gambas-bugtracker] Bug #1625: Resize error

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Sat Jul 13 21:24:43 CEST 2019


http://gambaswiki.org/bugtracker/edit?object=BUG.1625&from=L21haW4-

Comment #3 by Tony MOREHEN:

As Benoit alluded to earlier, you seem to be mixing up how X and Y coordinates work.

Me.X and Me.Y are relative to the to your desktop screen.  Unless your form is at the exact top-left corner of your screen, they will always be non-zero,

PictureBox1.X and PictureBox1.Y are relative to your form's top left corner.  As a result, assigning Me.X and Me.Y to PictureBox1.X and PictureBox1.Y sets those coordinates to non-zero values.  Gambas is doing exactly what you code says to do.

BTW, I find it preferable to avoid using Form_Resize in almost all cases.  Instead, set your form's arrangement to Fill.  Using the appropriate containers and Arrangements lets Gambas handle resize events automatically.

Tony MOREHEN changed the state of the bug to: Accepted.




More information about the Bugtracker mailing list