Solved

Setting a components property(option) at runtime.

Posted on 1998-08-17
4
170 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 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

730 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