Shouldn't it be
Rect.Left := 6 * Trunc(x / 6);
Rect.Top:= 6 * Trunc(y / 6);
?
-----Original Message-----
From: Jeremy Coulter [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 09, 2001 12:51 PM
To: Multiple recipients of list delphi
Subject: [DUG]: Some help pleaseHi all.I need a little guidence here.I have a image control that I have draw a grid onto.The grids are 6x pixels, and it is 72 "Cells" wide and 14 high.What I want to do is, when I click on the left mouse button in one of the "Cells" I want to find the rect of that "Cell" do I can fill the rect.I have had a go, but with no real success.i.e. . Rect.left:= x-trunc(x / 6);Rect.right:=rect.left+6;Rect.top:=y-trunc(y / 6);Rect.bottom:=Rect.top+6;but its not right.Can someone help me here by suggesting if not providing a better way ??cheers,Jeremy Coulter