[Gambas-bugtracker] Bug #2346: Form.Border and Form.Top

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Thu Dec 23 15:44:15 CET 2021


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

Comment #4 by Bruce STEERS:

Hi Ben.
I have just discovered why I was still getting a window placement issue.


Seems to have to do with scrollviews in my application.
the application is a window with 2 vertically aligned ScrollView objects, one fixed height and the other expanded and arranged vertically.

The window would always open too high (note, auto-resize=false) if it's position was lower screen, 
I added some Timer code to wait a moment after load then resize/move it again to the saved position.

I also had to separately first adjust height then Wait 0.1 then adjust top position in Form_Show() , ugly but was the only way.

I have now fixed it by doing the following.
During form load i set the ScrollView.Visible to False on both objects and set the window position.

At the end of Form_Show() i then set scrollview visible again.

Doing it that way the position is correct on opening and i do not need to resize first then move.

Somehow the scrollview objects being visible caused the form's top edge to be raised up higher to accommodate a larger height than was set and also effected Window.Move() so it could not place to lower screen without adjusting height with Window.Resize(W, H) before position with Window.Move(X, Y).

Not sure if that means anything to you?
Wishing well




More information about the Bugtracker mailing list