Solved

search through all edit boxes on your form

Posted on 2006-07-03
2
165 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video discusses moving either the default database or any database to a new volume.

757 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now