?
Solved

Setting a components property(option) at runtime.

Posted on 1998-08-17
4
Medium Priority
?
172 Views
Last Modified: 2010-04-04
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
0
Comment
Question by:Kmiller
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Expert Comment

by:DPedrelli
ID: 1337159
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.
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1337160
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
0
 

Author Comment

by:Kmiller
ID: 1337161
viktornet comment did the trick.... answer the questions and I'll give you credit.

Thanks
0
 
LVL 10

Accepted Solution

by:
viktornet earned 1200 total points
ID: 1337162
Ok, here it is....

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

Talk to you later! Bye...

Regards,
Viktor Ivanov
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question