我收到一个错误,表明MyRandomArray
当前上下文中不存在该错误。如何在 C# WinForms 应用程序中跨类访问变量?
public void Quiz_Load(object sender, EventArgs e)
{
string[] MyRandomArray = getWordList();
}
private void timer1_Tick(object sender, EventArgs e)
{
somefunction(MyRandomArray);/// MyRandomArray doesn't exist in the current context.
}