PDA

View Full Version : مشکل با CellRect در TStringGrid



AmirSky
شنبه 22 مهر 1391, 12:01 عصر
من با کدهای زیر وقتی در TStringGrid یک Shape ایجاد میکنم
بعد اسکرول stringGrid1 ،
Shape در مکان تعریف شده قرار نمی گیرد و جابجا میشود

procedure TForm1.btn1Click(Sender: TObject);
var
Rect : TRect;
shp1 : TShape;
begin
shp1 := TShape.create(stringGrid1);
with shp1 do
begin
parent := stringGrid1;
Brush.Color := clRed;
Rect := stringGrid1.CellRect(3,3) ;
Top := Rect.Top;
Left := Rect.Left;
Height := 40;
end;
end;

این هم نمونه برنامه

93918

BORHAN TEC
شنبه 22 مهر 1391, 17:59 عصر
http://stackoverflow.com/questions/9046861/stringgrid-with-buttons