Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check thru controls

Status
Not open for further replies.

Tomi71

Programmer
Oct 16, 2007
4
0
0
FI
Hello.

How can I check with code through all my controls (e.g. windows)?

To put it simply, how would I gather the Caption from every Window in my project and add them to a ListBox?

Idea is when the user double-clicks on a ListBox entry, it takes him to that Window with that specific Caption.

Thanks. :)
 
How's this?
Code:
{ show all names of all forms on the current form }
var
  i: integer;
  temp: TScreen;
  windcaption: string;
begin
  Memo1.Lines.Clear;
  for i := 0 to Screen.FormCount - 1 do
    begin
      Memo1.Lines.Add(Screen.Forms[i].Caption);
    end;
end;
 
Thank you!

It was the Screen and FormCount I wasn't aware of, but now that I am things will proceed.
 
note:
var
temp: TScreen;
windcaption: string;

are not needed.

Aaron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top