Solved

search through all edit boxes on your form

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi XE10, MySQL Query 4 143
Internet Explorer View Settings Question 15 111
how to center only a line in richedit? 4 57
When I am typing into a TEdit last word repeats 7 134
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

809 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