public Form1() { doubler = new Doubler(); InitializeComponent(); btnCommand1.Text = "+1"; btnCommand2.Text = "x2"; lblNumber.Text = "0"; btnReset.Text = "Сброс"; this.Text = "Удвоитель"; lblGoal.Visible = false; lblGoalText.Visible = false; lblStepsCount.Text = "0"; }
private void UpdateInfo() { //Обновить информацию на форме this.lblCurrent.Text = doubler.Current.ToString(); this.lblCount.Text = $"Шаг: {doubler.Count.ToString()} из {doubler.MinimumStep}"; tbMax.Text = doubler.Max.ToString(); bPlus.Enabled = bMulti.Enabled = (doubler.Count != doubler.MinimumStep); bReset.Enabled = bCancel.Enabled = (doubler.Count != 0); if (doubler.Current == doubler.Max) { MessageBox.Show("Вы выиграли!", "Поздравляем!"); doubler = new Doubler(); tbMax.Text = doubler.Max.ToString(); UpdateInfo(); } }
public fDouble() { InitializeComponent(); doubler = new Doubler(); UpdateInfo(); }
private void TsmiNewGame_Click(object sender, EventArgs e) { //Начать новую игру doubler = new Doubler(); UpdateInfo(); }