在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
1、新建 FM(HD) 工程, 先添加 TLine(默认名称是 Line1); 2、在 Line1 选择状态下添加 Button1; 3、取消选择后添加 Button2 此时, Button1.Parent 是 Line1; Button2.Parent 是窗体. unit Unit1; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Objects; type TForm1 = class(TForm) Line1: TLine; Button1: TButton; Button2: TButton; procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); end; var Form1: TForm1; implementation {$R *.fmx} procedure TForm1.FormCreate(Sender: TObject); begin Button2.OnClick := Button1.OnClick; { TLine } end; procedure TForm1.Button1Click(Sender: TObject); begin Caption := TButton(Sender).Parent.ClassName; { TForm1; 现在的窗体没有 Text 属性了 } Line1.Position.X := Line1.Position.X + 10; { Btuuon1 会随同移动 } end; end. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论