我试图创建一个从我的设置文件中取出数据的函数(HighscoreSaved放入highscoreList数组)然后加入字符串并将它们写入文本框(highScore.Text)
但是当我打电话给这个功能时没有任何反应
所以这是我的代码:Form1
private void button4_Click_1(object sender, EventArgs e)
{
Highscore.Fetch();
Highscore.Set();
}
public void highscoreText (string value)
{
this.highScore.Text = value;
}
Run Code Online (Sandbox Code Playgroud)
并且继承了应该由Highscore.Fetch()和Highscore.Set()调用的类.但是当我调用它们时,我的文本框中没有任何变化
public static class Highscore
{
public static void Fetch()
{
Form1.highscoreList[0] = "\t\t\t" + HighscoreSaved.Default.highscoreKeeper1 + "\t\t" + HighscoreSaved.Default.highscoreScore1;
Form1.highscoreList[1] = "\t\t\t" + HighscoreSaved.Default.highscoreKeeper2 + "\t\t" + HighscoreSaved.Default.highscoreScore2;
Form1.highscoreList[2] = "\t\t\t" + HighscoreSaved.Default.highscoreKeeper3 + "\t\t" + HighscoreSaved.Default.highscoreScore3;
Form1.highscoreList[3] = "\t\t\t" + HighscoreSaved.Default.highscoreKeeper4 + "\t\t" + HighscoreSaved.Default.highscoreScore4;
Form1.highscoreList[4] = "\t\t\t" + HighscoreSaved.Default.highscoreKeeper5 + "\t\t" + HighscoreSaved.Default.highscoreScore5;
Form1.highscoreList[5] …Run Code Online (Sandbox Code Playgroud)