Go Back   Wiki NewForum | Latest Entertainment News > Career Forum & Tips > Tech Forum & Tutorial > Oracle Database, SQL, Application, Programming


How to clear multiple edit controls without having to refer to them one by one


Reply
Views: 1643  
Thread Tools Rate Thread
  #1  
Old 08-20-2010, 10:42 AM
bholas bholas is offline
Award Winner
 
Join Date: Apr 2010
Posts: 4,977
Default How to clear multiple edit controls without having to refer to them one by one

So your new form has 40 edit controls, and now you're looking for a quick and easy way to clear all of them without having to refer to them one by one. How about using a function like this:

procedure TForm1.****on1Click(Sender: TObject);
var
i : integer;
begin
for i := 0 to ComponentCount-1 do
begin
if( Components[ i ] is TEdit )then
begin
(Components[ i ] as TEdit).Text := '';
end;
end;
end;



Reply With Quote
Reply

Tags
programming tips

New topics in Oracle Database, SQL, Application, Programming





Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
WikiNewForum)