private void RandomNumbersPairsCreate(int count, int maxNumber) { this.numbersPairs.Clear(); for (int i = 0; i < count; ++i) { NumbersPair numbersPair = new NumbersPair { Value = random.Next(maxNumber), ValueNext = random.Next(maxNumber) }; numbersPair.Size = TextRenderer.MeasureText(string.Format("{0} + {1}", numbersPair.Value, numbersPair.ValueNext), this.Font); numbersPair.Position = new PointF(random.Next(this.ClientSize.Width - numbersPair.Size.Width), random.Next(this.ClientSize.Height - numbersPair.Size.Height)); numbersPair.Step = new PointF((float)(random.NextDouble() - 0.5), (float)(random.NextDouble() - 0.5)); this.numbersPairs.Add(numbersPair); } }