[Lazarus] String Grid MouseToCell seems inconsistent when deleted some columns
Jesus Reyes
jesusrmx at yahoo.com.mx
Tue Sep 7 17:16:17 CEST 2010
--- El mar 7-sep-10, Lukasz Sokol <el.es.cr at gmail.com> escribió:
> De: Lukasz Sokol <el.es.cr at gmail.com>
> Asunto: Re: [Lazarus] String Grid MouseToCell seems inconsistent when deleted some columns
> A: "Lazarus mailing list" <lazarus at lists.lazarus.freepascal.org>
> Fecha: martes, 7 de septiembre de 2010, 10:01
> Hello faber,
>
> On 07/09/2010 15:45, faber wrote:
> [...]
> >
> > try with
> StringGrid1.MouseToCell(ScreenToClient(Mouse.CursorPos))
[...]
> Oh... yes that solved the issue. Sorry for the noise :) i
> was searching for
> the ScreenToClient, but $Deity knows why I was looking for
> it as procedure of
> the StringGrid itself :)
>
Indeed it should, and the correct translation of coordinates should be made with StringGrid1
StringGrid1.MouseToCell(StringGrid1.ScreenToClient(Mouse.CursorPos))
otherwise MouseToCell would get parent form coordinates.
Jesus Reyes A.
More information about the Lazarus
mailing list