Question : Help needed with procedure

Hi,

The procedure EnableAllRichEdits enables or disables all dbrichedits on
every tabsheet of a pagecontrol. But I don't want to use a PageControl
anymore, I have just the dbrichedit component now. So the procedure have
to be changed to enable/disable the dbrichedit. Can someone help me?

Thank you in advanced.

Peter Kiers
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
procedure TMainForm.EnableAllRichEdits(Enable: Boolean);
var i, ii : Integer;
     page : TTabSheet;
begin
     for i := 0 to PageControl1.PageCount - 1 do
          begin
          page := PageControl1.Pages[i];
          for ii := 0 to page.ControlCount - 1 do
               begin
               if page.Controls[ii] is DBRichEdit then
                    page.Controls[ii].Enabled := Enable;
               end;
          end;
end;

Answer : Help needed with procedure

procedure TMainForm.EnableAllRichEdits(Enable: Boolean);
var i : Integer;
begin
    for i := 0 to ControlCount - 1 do
        if Controls[i] is TDBRichEdit then
            Controls[i].Enabled:= Enable;
end;
Random Solutions  
 
programming4us programming4us