Solved

Invert a boolean value

Posted on 2006-11-12
1
203 Views
Last Modified: 2010-04-01
I have a Tcheckbox.
If the Tcheckbox is checked, I'd like an Tedit to be disabled.

In VB I would have written it like this
Tedit.Enabled = Not Tcheckbox.value

How would I write this in C++

Arild
0
Comment
Question by:arildj78
1 Comment
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 17926630
In C++, you can do that in a similar way using the '!' (logical not) operator, e.g.

Tedit.Enabled = !Tcheckbox.value;

0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

705 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

16 Experts available now in Live!

Get 1:1 Help Now