Solved

search through all edit boxes on your form

Posted on 2006-07-03
2
173 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…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

740 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