Link to home
Start Free TrialLog in
Avatar of Kmiller
Kmiller

asked on

Setting a components property(option) at runtime.

I'm using Plasmatech Software's Shell Control Pack ver 1.3f under Delphi 4.0. I want to set a property of ShellListView at runttime. I'd like to toggle the option ptsloHideFoldersWhenLinkedToTree from true to false at runtime. It looks like ShellListView.Options should be able to set the option but i can't figure it out. This is what the help file says about .option:

Delphi Declaration

property Options: TPTShellListOptions;

Delphi Declaration

type TPTShellTreeOption = ( ptstoAutoFill, ptstoVirtualFolders,
       ptstoDesignInteractive, ptstoDefaultKeyHandling, ptstoContextMenus,       ptstoDynamicRefresh, ptstoOleDrag, ptstoOleDrop, ptstoShowHidden );
     TPTShellTreeOptions = set of TPTShellTreeOption;

type TPTShellListOption = ( ptsloAutoFill, ptsloNonFilesystemAncestors,

 ptsloDesignInteractive, ptsloDefaultKeyHandling,  ptsloContextMenus, ptsloDontChangeFolder, ptsloDontGoBelowBase, ptsloDynamicRefresh, ptsloHideFoldersWhenLinkedToTree, ptsloOleDrag, ptsloOleDrop, ptsloFolderContextMenu, ptsloShowHidden);

     TPTShellListOptions = set of TPTShellListOption;

type TPTShellComboOption = ( ptscoAutofill, ptscoNonFilesystemAncestors );
     TPTShellComboOptions = set of TPTShellComboOption;

That about all that it tells and I have no idea what to do. Everything I try with ShellListView.Options gives an error. Any help with getting this to work would be great. Thanks
Avatar of DPedrelli
DPedrelli

How are you trying to set the property?

If it is a Delphi component and the property is public, all you should have to do is first make sure that the unit that declares the enumerated type for the property value is included in your unit and then set the property by ComponentName.PropertyName := value;

Hope this helps.
D.
You can do like this....

TheComp.Options := TheComp.Options - [ptsloHideFoldersWhenLinkedToTree];

.so if it is set to true this would remove it and make it false...

Is that what you were looking for?

Regards,
Viktor Ivanov
Avatar of Kmiller

ASKER

viktornet comment did the trick.... answer the questions and I'll give you credit.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of viktornet
viktornet
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial