Sorry again
I just want to ask a quick question:
How do you know what Component number one item is. Like label 7, how do you know? I tried looking but couldn't find it. I also tried logic lol, as in, the 10th one on the list (to the left of delphi) would be the 10th component. But its not, as I tested it.
Thanks
Code:unit Unit3; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Label1: TLabel; Edit1: TEdit; Edit2: TEdit; Label2: TLabel; Edit3: TEdit; Label3: TLabel; Edit4: TEdit; Label4: TLabel; Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.Button1Click(Sender: TObject); var count : integer; begin for count:= 0 to (Componentcount-1) do begin showmessage('component['+inttostr(count)+'] = ' + Components[count].name ); end end; end.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks