主题:请问各位大侠
zhh123
[专家分:0] 发布于 2006-12-03 22:36:00
我想问一下,我想在程序运行的过程中显示控件的预先设定的属性,怎么搞呢?
回复列表 (共1个回复)
沙发
wealthy [专家分:1840] 发布于 2006-12-04 09:56:00
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Button1: TButton;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);//以TLabel控件为例,显示TLabel控件的属性;
begin
Edit1.Text:=inttostr(Label1.Width);
Edit2.Text:=Label1.Caption;
Edit3.Text:=Label1.Name;
Edit4.Text:=inttostr(Label1.Top);
end;
end.
我来回复