It’s supposed to work like this in c#, but what’s the equivalent in c++/cli?
private void CustomControl_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
... do something
}
}
MouseButtons.Right, MouseButtons::Right and MouseButtons->Right all don’t seem to compile. It always says
error C2039: 'Right' : is not a member of 'System::Enum'
Here is my c++/cli code:
System::Void WindowTest::pictureBoxTest_MouseClick(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e)
{
if (e->Button == MouseButtons::Left)
{
// do something
}
}
From here you seem to be missing the
::before yourMouseButtons::Right