它應該在c#中像這樣工作,但C++/cli中的等價物是什麼?如何檢查在C++/cli中的MouseClick事件期間點擊了哪個鼠標按鈕?
private void CustomControl_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
... do something
}
}
MouseButtons.Right,MouseButtons :: Right和MouseButtons-> Right全部似乎沒有編譯。它總是說
error C2039: 'Right' : is not a member of 'System::Enum'
這裏是我的C++/CLI代碼:
System::Void WindowTest::pictureBoxTest_MouseClick(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e)
{
if (e->Button == MouseButtons::Left)
{
// do something
}
}
發佈的C#代碼無關.. 。爲什麼不發佈你擁有的C++/CLI代碼? – Marlon