我想从其他控件访问listView来从结构中输入数据,但我不知道该怎么做。`SavethescoreScoreDialog = new Savethescore(); HallofGlory HofG =新的HallofGlory();
private void saveTheScoreToolStripMenuItem_Click(object sender, EventArgs e)
{
ScoreDialog.ShowDialog();
if (ScoreDialog.DialogResult == DialogResult.OK)
{
string sLevel = "Level 1";
if (bLevel1)
sLevel = "Level 1";
if (bLevel2)
sLevel = "Level 2";
SStat Player = new SStat(ScoreDialog.textBox1.Text, sLevel, m_iHits, m_iShots, m_iSpeed, m_iSpeed, CountPercents(m_iHits, m_iShots));
ListViewItem NewPlayer = new ListViewItem(Player.m_sName);
NewPlayer.SubItems.Add(Player.m_sLevel);
NewPlayer.SubItems.Add(Player.m_iHits.ToString());
NewPlayer.SubItems.Add(Player.m_iShots.ToString());
NewPlayer.SubItems.Add(Player.m_iSpeed.ToString());
NewPlayer.SubItems.Add(Player.m_dPercentage.ToString() + "%");
HofG.listView1.Items.Add(NewPlayer);
}
}`