我希望左键单击增加,右键单击减少我尝试过代码中显示的内容
private:System :: Void button4_MouseDown(System :: Object ^ sender,System :: Windows :: Forms :: MouseEventArgs ^ e){
switch (MouseButtons)
{
case MouseButtons.Left:
c = Convert::ToInt32(bc->Text);
c++;
bc->Text = c.ToString();
break;
case MouseButtons.right:
c = Convert::ToInt32(bc->Text);
c--;
bc->Text = c.ToString();
break;
}
}
但是我收到了这个错误
错误(活动)'this'不能用于常量表达式