Solved

Problem disabling an element of a set

Posted on 2004-08-16
3
200 Views
Last Modified: 2010-04-05
I have a a control that I am working with.  When I look at it in the Object inspector, I see the properties.  One of the properties (SearchProperties) has a '+' sign beside it.  I click on the '+' and the properties expand.  One of the sub-properties is of particular interest.  It is called 'okIncludeSubFolder'.  it can be either True or False.  It is one of a set of sub-properties of SearchProperties.  My issue is that I need to be able to set it to True or False PROGRAMATICALLY.  

I can set it to true without problem....

    If ProcessSubFolders.Checked = True then
        ES1.SearchOptions := [okIncludeSubFolder]

I cannot figure out how to set it to False.

Any help appreciated.

Thanks
George S
0
Comment
Question by:gspears060598
  • 3
3 Comments
 
LVL 2

Accepted Solution

by:
beermequik earned 125 total points
ID: 11813032
This will work

 ES1.SearchOptions := ES1.SearchOptions - [okIncludeSubFolder];
0
 
LVL 2

Expert Comment

by:beermequik
ID: 11813046
you should also set it this way....

If ProcessSubFolders.Checked = True then
        ES1.SearchOptions := WS1.SearchOptions +  [okIncludeSubFolder];

that way the other properties of the TSearchOptions arent affected.
0
 
LVL 2

Expert Comment

by:beermequik
ID: 11813067
one more thing.....

It is a better practice not to use "if a=true.."

just use " if a"

so your code would be...

If ProcessSubFolders.Checked then
        ES1.SearchOptions := WS1.SearchOptions +  [okIncludeSubFolder];

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

830 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