用户控件中的数组 [英] array in user control
本文介绍了用户控件中的数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
此代码是正确的还是有任何错误.请帮助....
在用户控制中:
Is this code is correct or have any mistake.Plz help....
in user control:
private Point[] _pin1PointPath = new Point[4];
private Point[] _pin2PointPath = new Point[4];
public Point[] pin1PointPath
{
get { return _pin1PointPath; }
}
public Point[] pin2PointPath
{
get { return _pin2PointPath; }
}
public void setInput()
{
if (temp_StaticVariable.staticVariable.ps_inputpinNo2 == 1)
{
/////....
_pin1PointPath = ps_Path;
///...
}
else
{
/////....
_pin2PointPath = ps_Path;
.....
}
}
在主页中:
In main page:
vAnd[i].setInput();
///....
实际上,这两个变量的行为都像静态变量...
我听不懂我也用过brekpoint.所有vAnd仅对这些变量具有相同的值.
actually these both variable behaving like a static variable...
I am not able to understand. i used brekpoint also. all vAnd have same value for only these variable.
推荐答案
朋友,
尝试一下,
hi friend,
Just try with this,
private Point[] _pin1PointPath = new Point[4];
private Point[] _pin2PointPath = new Point[4];
public Point[] pin1PointPath
{
get { return _pin1PointPath[number]; }
}
public Point[] pin2PointPath
{
get { return _pin2PointPath[number]; }
}
public void setInput()
{
if (temp_StaticVariable.staticVariable.ps_inputpinNo2 == 1)
{
/////....
_pin1PointPath[number] = ps_Path;
///...
}
else
{
/////....
_pin2PointPath[number] = ps_Path;
.....
}
}
谢谢,
Mahesh Patel
Thanks,
Mahesh Patel
这篇关于用户控件中的数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文