Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing the properties of TEdit in a form 1

Status
Not open for further replies.

kinabalu

Programmer
Sep 21, 2007
8
MY
Hi,
I am a newbie. I have several TEdit controls in a form. How would I change the properties of all of them simultaneously? For example, I want to change the enable property of dit1, Edit2, Edit3, .... simultaneously.

TQ
 
Use the Form's Components and ComponentCount properties:
Code:
var
  i: Integer;
begin
  for i := 0 to Self.ComponentCount - 1 do
    if Components[i] is TEdit then
      (Components[i] as TEdit).Enabled := False;
end;

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
another option is to put them all on a panel with no border and set the panels enabled property.

Aaron
 
Tq Stretchwickster and aaronjme for the responses.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top