Solved

Problem disabling an element of a set

Posted on 2004-08-16
3
197 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…
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…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 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

20 Experts available now in Live!

Get 1:1 Help Now