コード例 #1
0
ファイル: Form1.cs プロジェクト: MelnikovSG/Homework
 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";
 }
コード例 #2
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();
     }
 }
コード例 #3
0
 public fDouble()
 {
     InitializeComponent();
     doubler = new Doubler();
     UpdateInfo();
 }
コード例 #4
0
 private void TsmiNewGame_Click(object sender, EventArgs e)
 {
     //Начать новую игру
     doubler = new Doubler();
     UpdateInfo();
 }