我想从另一个类(Class2)获取变量xx,并将其设置为等于form1.cs中的变量mouseX。
form1.cs的示例代码:
private void canvas_MouseClick(object sender, MouseEventArgs e)
{
mouseX = Cursor.Position.X;
mouseY = Cursor.Position.Y;
//I am thinking here I could do Class2.xx = mouseX in order to set the variable xx
// equal to the newly acquired mouseX value, but this is not the case
}