Petzolds C# book has code like this:
(mea.Button & MouseButtons.Right != 0)
I try the C++/CLI analog:
if( (e->Button & ::MouseButtons::Left) != 0 )
but get errors:
error C2678: binary '!=' : no operator found which takes a left-hand
operand of type 'System::Windows::Forms::MouseButtons' (or there is no
acceptable conversion)
why?
SvenC - 19 Sep 2007 07:18 GMT
Hi dragonslayer008,
> Petzolds C# book has code like this:
>
[quoted text clipped - 9 lines]
> operand of type 'System::Windows::Forms::MouseButtons' (or there is no
> acceptable conversion)
Use if((e->Button & ::MouseButtons::Left) == ::MouseButtons::Left) which
uses the same type on both sides of the operator. Otherwise you would need
to cast either of the two sides explicitly.
--
SvenC