Board index » cppbuilder » I sure feel dumb asking this

I sure feel dumb asking this

This is more of a question about C++ but I thought I would ask it here...

How do you change the value of an ENUM property programmatically?  In my
case I am using a TDBGrid component and want to change the Options property
in my code.  The problem is that Options is an ENUM type and I am totally at
a loss on how to change the dgEditing from false to true in my code.

Here is what I am trying:

DBGrid1->Options{dgEditing} = true;
and
DBGrid1->Options{dgEditing = true};

Both tell me that I am missing a semi-colon.

I tried digging out my old C++ books, but could find nothing on how to
modify an ENUM value.

Any help is appreciated.  Thanks!
njka...@mailbag.com

 

Re:I sure feel dumb asking this


Quote
"Nelson Kaeppel" <njka...@mailbag.com> wrote in message

news:3a4428f2$1_1@dnews...

Quote
> How do you change the value of an ENUM property programmatically?  In my
> case I am using a TDBGrid component and want to change the Options
property
> in my code.  The problem is that Options is an ENUM type and I am totally
at
> a loss on how to change the dgEditing from false to true in my code.

First off, Options is a Set<>, not an enum.  Set<> can build from an enum,
though.

Now when, to change the Options property, you do it like this:

// to add dgEditing
DBGrid1->Options = DBGrid1->Options << dgEditing;

// to remove dgEditing
DBGrid1->Options = DBGrid1->Options >> dgEditing;

Gambit

Re:I sure feel dumb asking this


Thanks!
Quote
"Remy Lebeau" <gambi...@gte.net> wrote in message

news:921ckk$qsq2@bornews.inprise.com...
Quote

> "Nelson Kaeppel" <njka...@mailbag.com> wrote in message
> news:3a4428f2$1_1@dnews...

> > How do you change the value of an ENUM property programmatically?  In my
> > case I am using a TDBGrid component and want to change the Options
> property
> > in my code.  The problem is that Options is an ENUM type and I am
totally
> at
> > a loss on how to change the dgEditing from false to true in my code.

> First off, Options is a Set<>, not an enum.  Set<> can build from an enum,
> though.

> Now when, to change the Options property, you do it like this:

> // to add dgEditing
> DBGrid1->Options = DBGrid1->Options << dgEditing;

> // to remove dgEditing
> DBGrid1->Options = DBGrid1->Options >> dgEditing;

> Gambit

Other Threads