I am using TAdvToolBarPager with many pages(AdvPage1, AdvPage2, AdvPage3...).Each page contains many edits,navigators,etc.. Based on the user right i would like to constraint properties, i.e for ADMIN i would like to show all the pages (1,2,3) but for USER i would like to show only page (1,2) or (1).
I am able to disable all edits,navigators using the code given below. Could some one help how i can set the pages in TAdvToolBarPager visble based on constraints/ Any other alternative way to achieve this. Thanks in advance!
Procedure SetForm(Form: TForm; enabled: Boolean);
var PropInfo : PPropInfo;
i : Integer;
begin
for i := 0 to Pred(Form.ComponentCount) do
begin
if (Form.Components[i] is TDBEdit) or (Form.Components[i] is DBNavigator) then
begin
PropInfo := GetPropInfo(Form.Components[i].ClassInfo, 'Enabled');
if PropInfo <> nil then
SetOrdProp(Form.Components[i], PropInfo, Ord(enabled));
end;
end;
end;