Examples Delphi

The following function hides a given control specified by its componentname:

procedure TForm1.ShowHideComponent(ComponentName: String);
var
TmpComp: TComponent;
begin
TmpComp := FindComponent(ComponentName)
if TmpComp <> Nil then
if TmpComp is TControl then
TControl(TmpComp).Hide;
end;