Hi,
i have two modes of my delphi forms – EDIT and READONLY. In READONLY i set .Enabled = False to every component (apart from TPageControl) using such a loop:
Code:
procedure SetControls()
var
i : integer
begin
for i := 0 to Component.ControlCount – 1 do
begin
if (Component.Controls is TWinControl) then
begin
if not (Component.Controls is TPageControl) then
(Component.Controls as TWinControl).Enabled := False;
if (Component.Controls as TWinControl).ControlCount > 0 then
SetControls(Component.Controls as TWinControl, False);
end;
end;
end;
Now i want also to enable the TsFrameBar so that items can be clicked, opened and viewed. I tried this , but thats not working:
Code:
if not (Component.Controls is TPageControl) or not (Component.Controls is TsFrameBar) or not (Component.Controls is TsTitleButton) then
Also i tried this, but it does not compile:
Code:
if not (Component.Controls is TPageControl) or not (Component.Controls is TsFrameBar) or not (Component.Controls is TsTitleButton) or not (Component.Controls is TsTitleItem) or not (Component.Controls is TsTitles) then
[Error] Tools.pas(122): Incompatible types: 'TsTitleItem' and 'TControl'
[Error] Tools.pas(122): Incompatible types: 'TsTitles' and 'TControl'
Any idea how to get this working?