5,392
社区成员
发帖
与我相关
我的任务
分享
procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
begin
for i:= 0 to self.ComponentCount - 1 do
begin
if Components[i].name = 'Button4' then
ShowMessage(Components[i+1].Name);
end;
end;
object Form1: TForm1
Left = 226
Top = 153
Width = 696
Height = 480
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
Menu = MainMenu1
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Edit1: TEdit
Left = 336
Top = 128
Width = 121
Height = 21
TabOrder = 2
Text = 'Edit1'
end
object Button1: TButton
Left = 208
Top = 296
Width = 75
Height = 25
Caption = 'Button1'
TabOrder = 0
end
object Button2: TButton
Left = 408
Top = 272
Width = 75
Height = 25
Caption = 'Button2'
TabOrder = 1
OnClick = Button2Click
end
object Edit2: TEdit
Left = 368
Top = 32
Width = 121
Height = 21
TabOrder = 3
Text = 'Edit2'
end
object Edit3: TEdit
Left = 200
Top = 64
Width = 121
Height = 21
TabOrder = 4
Text = 'Edit3'
end
object RadioButton1: TRadioButton
Left = 128
Top = 40
Width = 113
Height = 17
Caption = 'RadioButton1'
TabOrder = 5
end
object MainMenu1: TMainMenu
Left = 232
Top = 96
end
end
、