[Gambas-user] GridView and Current.Y

Benoît Minisini gambas at ...1...
Tue Feb 23 12:39:54 CET 2016


Le 22/02/2016 17:43, Rolf-Werner Eilert a écrit :
> Currently, I'm porting an old calendar project from Gambas2 to Gambas3.
>
> There is a GridView which shows days and times. It has 24 rows, so in
> order to show a Baines Line, the code was
>
> GridView.Row = Hour(Now)
>
> baines.Y = GridView.Y + GridView.Current.Y + ((GridView.Current.Height /
> 60) * Minute(Now))
>
> In Gambas3, GridView.Current.Y seems to give the relative position from
> the upper edge of the whole grid, even when it is not visible. That
> means, instead of values like 745, it now receives 1035, so the Baines
> Line will be too low to appear.
>
> What would you use instead of Current.Y to hit the right square of the
> GridView?
>
> Thanks for your help.
>
> Regards
> Rolf
>
>

GridView.Current.Y - GridView.ScrollY + GridView.ClientY should do the 
job. It returns the top cell relative to the GridView top.

-- 
Benoît Minisini




More information about the User mailing list