dcrudo
asked on
Tabsheet componentCount returning always Zero ?
Dear Experts,
when I Execute the following:
procedure TForm1.ClearForm(AForm : TsuiTabSheet);
var i : Integer;
begin
begin
For i := 0 to AForm.ComponentCount -1 do
begin
if (AForm.Components[i] is TcxTextEdit) then
begin
(AForm.Components[i] as tcxTextEdit).Text := '';
end;
end;
end;
end;
The TsuiTabSheet is a Tabsheet from a Page Control Component... since it was not working... I've checked the value returned
by AForm.ComponentCount and it is zero.
I would like to check all components on the The Tabsheet page and if they are TextEdit, clear their content...
any idea?
Thank you!
Dave
when I Execute the following:
procedure TForm1.ClearForm(AForm : TsuiTabSheet);
var i : Integer;
begin
begin
For i := 0 to AForm.ComponentCount -1 do
begin
if (AForm.Components[i] is TcxTextEdit) then
begin
(AForm.Components[i] as tcxTextEdit).Text := '';
end;
end;
end;
end;
The TsuiTabSheet is a Tabsheet from a Page Control Component... since it was not working... I've checked the value returned
by AForm.ComponentCount and it is zero.
I would like to check all components on the The Tabsheet page and if they are TextEdit, clear their content...
any idea?
Thank you!
Dave
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That's exactly what I was looking for!
Thank you soo much!
Dave
Thank you soo much!
Dave
for i := 0 to ComponentCount-1 do
begin
if Components[i] is TControl then
begin
if ((Components[i] as TControl).Parent.Name = 'TabSheet1')
and (Components[i] is TEdit) then
(Components[i] as TEdit).Text := '';
end;
end;