Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

search through all edit boxes on your form

Posted on 2006-07-03
2
Medium Priority
?
182 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
[X]
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
  • 2
2 Comments
 
LVL 4

Accepted Solution

by:
kenpem earned 200 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

688 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