Board index » delphi » Q: How to manage items in StringGrid.Options

Q: How to manage items in StringGrid.Options

Hi
I thought I could write Include(MyGrid.Options,goEditing) and also Exclude(MyGrid.Options,goEditing) but the compiler refuses to accept this.

What is the right way to programmatically add/subtract items in the Options set?

Thanks in advance
Tor

 

Re:Q: How to manage items in StringGrid.Options


Try

    MyGrid.Options := MyGrid.Options + [goEditing] ;

    MyGrid.Options := MyGrid.Options - [goEditing] ;

Quote
Tor Tveitane wrote:
> Hi
> I thought I could write Include(MyGrid.Options,goEditing) and also
> Exclude(MyGrid.Options,goEditing) but the compiler refuses to accept
> this.

> What is the right way to programmatically add/subtract items in the
> Options set?

> Thanks in advance
> Tor

Re:Q: How to manage items in StringGrid.Options


In article <6cc752$l5...@o.online.no>, "Tor Tveitane" <bush...@online.no>
writes:

Quote
>I thought I could write Include(MyGrid.Options,goEditing) and also =
>Exclude(MyGrid.Options,goEditing) but the compiler refuses to accept =
>this.

>What is the right way to programmatically add/subtract items in the =
>Options set?

You cannot use properties as var parameters to a procedure / function. And that
was what you were trying to do by using the Include / Exclude procedure.

You should use the + (union) and - (difference) operators for sets.

StringGrid1.Options := StringGrid1.Options + [goColSizing, goRowSelect];

Note that you've got to work in _sets_ of options by enclosing a comma
separated list of options in square brackets.

Alan Lloyd
alangll...@aol.com

Other Threads