Moving rectangle around StringGrid

From: Ray Hall (rayhall_at_bigpond.net.au)
Date: 03/28/05


Date: Sun, 27 Mar 2005 23:56:25 GMT

Hello,

I am trying to move a rectangle around on a StringGrid. I can draw the
rectangle using FrameRect, but I end up with many rectangles as I move it.
This is some of the code I am using and a link to a video of what I want to
achive.

http://www.turbofast.com.au/bin/GhostBox.avi (240k)

with StringGrid1 do
  begin
     Cells[xCel, yCel]:= FloatToStr(air);
     Update;
     TheRect := Rect(L + x,T + y,R + x,B + y);
     Canvas.Brush.Color := clRed;
     Canvas.FrameRect(TheRect);
  end;

Thanks,

Ray Hall.



Relevant Pages

  • Re: BITMAP & grid
    ... With Rectangle(), I can draw the gird but the interior of the ... > // Create a pattern brush from the bitmap. ... >> I would try FrameRect() with a patterned brush. ...
    (microsoft.public.win32.programmer.gdi)
  • Re: BITMAP & grid
    ... With Rectangle(), I can draw the gird but the interior of the ... If I use FrameRect(), it doesn't work. ... // Create a pattern brush from the bitmap. ...
    (microsoft.public.win32.programmer.gdi)
  • RE: GDI+ Clip Region allows 0.0f width pen to draw through
    ... Just to make this more outrageous if you draw the vertical lines from the ... I took the previous code I posted and made the panel anchor to all four ... private void panel1_SizeChanged ... In other words create a rectangle that is a wider than the panel. ...
    (microsoft.public.win32.programmer.gdi)
  • Re: My earlier post was Horizontal Line
    ... The code below is the exact of my Report module. ... It can draw the table ... starting point for the line or rectangle. ... QBColor function to specify the color. ...
    (microsoft.public.access.formscoding)
  • Zero Width Pen Draws through clipped region...
    ... Exclude the rectangle from the graphics clip region. ... Draw a line down the panel. ... IF you use a pen that is more than one pixel the clipping works correctly. ...
    (microsoft.public.dotnet.framework.drawing)