Это программа, которая использует несколько форм.
Когда я иду, нажимаю кнопку обновления счета, я получаю совершенно другую форму, называемую счетом на своем месте.
Однако, как только я введу имя и счет, появится обновление score
Форма после нажатия ОК.
Есть ли способ получить только обновленную форму score
как отдельную форму, не проходя через форму score
?
Обновление score
Форма:
public UppDateScore()
{
InitializeComponent();
score link = new score();
DialogResult bUpdate = link.ShowDialog();
if (bUpdate == DialogResult.OK)
{
txtName.Text = link.tagName.ToString();
numberBox.Items.Add((string)link.Tagnumbers);
//TagNumbs2
numberBox.Items.Add((string)link.TagNumbs2);
// TagNumbers3
numberBox.Items.Add((string)link.TagNumbers3);
}
}
Оригинальная форма:
private void bUpdate_Click(object sender, EventArgs e)
{
UppDateScore update = new UppDateScore();
update.Show();
}
score
Форма:
private void bClearScores_Click(object sender, EventArgs e)
{
txtName.Text = "";
txtScore.Text = "";
txtStoreScores.Text = "";
}
private void bOk_Click(object sender, EventArgs e)
{
string name = txtName.Text;
int score = Convert.ToInt32(txtScore.Text);
int amount = list[0]+ list[1]+list[2];
string test = null;
test = amount.ToString();
string msg = null;
msg = name;
//just get the name
string theName = null;
theName = name;
// just get the numbers you typed in
// first number
string aNumber = null;
int theNumbers1 = list[0];
aNumber = theNumbers1.ToString();
// sencend number
string theNumber2 = null;
int theNumbers2 = list[1];
theNumber2 = theNumbers2.ToString();
// third number
string theNumber3 = null;
int theNumbers3 = list[2];
theNumber3 = theNumbers3.ToString();
// get the amount in the list
string amountSize = null;
int scoreSize = list.Count;
amountSize = scoreSize.ToString();
// get the avarage
int avarge = amount / scoreSize;
string theAvarge = null;
theAvarge = avarge.ToString();
foreach (int s in list) {
msg += " | " + s.ToString();
}