Solved

Setting a components property(option) at runtime.

Posted on 1998-08-17
4
166 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
  • 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 300 total points
ID: 1337162
Ok, here it is....

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

Talk to you later! Bye...

Regards,
Viktor Ivanov
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now