Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

search through all edit boxes on your form

Posted on 2006-07-03
2
171 Views
Last Modified: 2010-04-05
I want to write a for loop of some kind that will go through all of the editboxes on my form.

e.g.
for editbox in form
begin
  //do processing on current editbox
end

I'm sure there's an easy solution to this but I'm new with delphi and am having trouble finding a good reference.  
0
Comment
Question by:ICPooreman
  • 2
2 Comments
 
LVL 4

Accepted Solution

by:
kenpem earned 50 total points
ID: 17032362
I use a similar thing to get the default text out of my edit boxes....

  for x := 0 to ComponentCount-1 do
    if Components[x] is TEdit then
      (Components[x] as TEdit).Text := '';

Hope that helps!
0
 
LVL 4

Expert Comment

by:kenpem
ID: 17032373
It's part of my default .FormCreate method:

procedure TfrmBTCollectMain.FormCreate(Sender: TObject);
var x: integer;
begin
  inherited;
  Application.Title := Caption;
  for x := 0 to ComponentCount-1 do
    if Components[x] is TEdit then
      (Components[x] as TEdit).Text := '';
end;

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question