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 ptsloHideFoldersWhenLinked ToTree 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, ptsloNonFilesystemAncestor s,
ptsloDesignInteractive, ptsloDefaultKeyHandling, ptsloContextMenus, ptsloDontChangeFolder, ptsloDontGoBelowBase, ptsloDynamicRefresh, ptsloHideFoldersWhenLinked ToTree, ptsloOleDrag, ptsloOleDrop, ptsloFolderContextMenu, ptsloShowHidden);
TPTShellListOptions = set of TPTShellListOption;
type TPTShellComboOption = ( ptscoAutofill, ptscoNonFilesystemAncestor s );
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
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, ptsloNonFilesystemAncestor
ptsloDesignInteractive, ptsloDefaultKeyHandling, ptsloContextMenus, ptsloDontChangeFolder, ptsloDontGoBelowBase, ptsloDynamicRefresh, ptsloHideFoldersWhenLinked
TPTShellListOptions = set of TPTShellListOption;
type TPTShellComboOption = ( ptscoAutofill, ptscoNonFilesystemAncestor
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
You can do like this....
TheComp.Options := TheComp.Options - [ptsloHideFoldersWhenLinke dToTree];
.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
TheComp.Options := TheComp.Options - [ptsloHideFoldersWhenLinke
.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
ASKER
viktornet comment did the trick.... answer the questions and I'll give you credit.
Thanks
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
Hope this helps.
D.