- 20
- 0
- 约1.58千字
- 约 3页
- 2017-08-20 发布于江苏
- 举报
获取窗口矩形的几种方法
获取窗口矩形的几种方法
其中 GetClientRect、ClientRect 获取的是窗口的客户区矩形;
GetWindowRect、BoundsRect 是获取窗口矩形;
另外, 还有一个 Windows.GetClientRect(使用方法同 GetWindowRect, 它们都是 API 函数),
这里使用的 GetClientRect 是 Forms.GetClientRect.
本例效果图:
unit Unit1;
interface
uses
Windows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,
Dialogs,StdCtrls;
type
TForm1=class(TForm)
procedureFormCreate(Sender:TObject);
procedureFormPaint(Sender:TObject);
procedureFormResize(Sender: TObject);
end;
var
Form1:TForm1;
implementation
{$R *.dfm}
procedureTForm1.FormCreate(Sender:TObject);
begi
原创力文档

文档评论(0)