2010/9/7 Lukasz Sokol <el.es...@gmail.com>: > procedure TForm1.StringGrid1Click(Sender: TObject); > var gridcell : TPoint; > begin > gridcell := StringGrid1.MouseToCell(Mouse.CursorPos); > > StringGrid1.Cells[gridcell.x,0] := IntToStr(gridcell.x); > {what text do you get in fixed row of the visible column you've just clicked > ?} > {my project got 0, 2, 4, 6, 8 } > {and I want 0,1,2,3,4 actually} > end;
try with StringGrid1.MouseToCell(ScreenToClient(Mouse.CursorPos)) or better use X,Y with OnMouseDown: StringGrid1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); best regards faber -- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus