views:

66

answers:

2

Hello! I have question: How to switch off highlight keyword "event" in Visual C++ 2010? I don't use .net , so for me it isn't keyword, and I would call it one variable "event".

+3  A: 

Unfortunately there is no way to do this. This is hard coded to be a keyword in Visual Studio's C++ editor and cannot be changed. It's the equivalent of saying "Please stop highlighting class"

JaredPar
+1 iff s/in C++/in Visual Studio/. `event` is not a C++ keyword.
Billy ONeal
@Billy, updated it to be more clear that it's Visual Studio's C++ editor that considers it a keyword (not the C++ language)
JaredPar
@JaredPar: +1 to you :)
Billy ONeal
...nonetheless, you can tell other editors (eg: emacs, codewright, etc.) to quit highlighting any keyword you want with a little effort.
T.E.D.
+1  A: 

This is a side-effect of the C++/CLI language supported by the IDE. Where event is a keyword. There are others, like gcnew, generic, array, etc. Syntax highlighting is based on the file name extension and C++/CLI also uses .cpp.

I can't think of an easy fix. I'd recommend you post feedback to connect.microsoft.com

Hans Passant