我有一个Form
,其代码类似于:
public partial class Form1 : Form
{
private int m_var1;
private int m_var2;
string sMsg;
bool bReturn;
private bool MyFunction()
{
// POINT A: at this point m_var1 and m_var2 are both 100
sMsg = "Test Message";
bReturn = (DialogResult.Yes == MessageBox.Show(sMsg, "MyApp",MessageBoxButtons.YesNo, MessageBoxIcon.Question));
// POINT B: at this point m_var1 and m_var2 are both 0
}
}
为什么POINT B
m_var1
和m_var2
都变成了0
,正如我所遇到的那样?
答案 0 :(得分:2)
这听起来像一个线程问题。我可以解释一下我将如何解决这个问题:
检查触及setter的代码的堆栈跟踪。