TRect是什么类型阿?(20分)

  • 主题发起人 主题发起人 Larruping
  • 开始时间 开始时间
看Help文档
 
是普通的数据结构:矩形
TRect = record
case Integer of
0: (Left, Top, Right, Bottom: Integer);
1: (TopLeft, BottomRight: TPoint);
end;
 
按F1查找trect
TRect defines a rectangle.

Unit

Types

type
TRect = packedrecord
case Integer of
0: (Left, Top, Right, Bottom: Integer);
1: (TopLeft, BottomRight: TPoint);
end;

Description

TRect represents the dimensions of a rectange. The coordinates are specified as either four separate integers representing the left, top, right, and bottom sides, or as two points representing the locations of the top left and bottom right corners.

Typically, TRect values represent pixel locations, where the origin of the pixel coordinate system is in the top left corner of the screen (screen coordinates) or the top left corner of a control抯 client area (client coordinates). When a TRect value represents a rectangle on the screen, by convention the top and left edges are considered inside the rectangle and the bottom and right edges are considered outside the rectangle. This convention allows the width of the rectangle to be Right - Left and the height to be Bottom - Top.
 
var
myRect : TRect;
begin
myRect.Top := 1;
myRect.Right := 1;
myRect.Left := 1;
myRect.Bottom := 1;
StringGrid1.Selection := myRect;
end;
就是这个用于选取区域的数组型。
 
矩形类型
 
TRect = record
case Integer of
0: (Left, Top, Right, Bottom: Integer);
1: (TopLeft, BottomRight: TPoint);
end;
 
多人接受答案了。
 
后退
顶部