public Korzina() { InitializeComponent(); BackColor = Properties.Settings.Default.SaveColor3; panel1.BackColor = Properties.Settings.Default.SaveColorPanel2; if (Продукты.Language == "Английский") { Translate(Продукты.Eng_word); } if (Продукты.Language == "Русский") { Translate(Продукты.Ru_word); } int prices = 0; int x = 0; int y = 0; //foreach (Food eda in Продукты.aue) foreach (KeyValuePair <Food, int> eda1 in Продукты.korz228) { Food eda = eda1.Key; int count = eda1.Value; UserControl1 picture = new UserControl1(eda, count); picture.Location = new Point(x, y); panel1.Controls.Add(picture); x = x + 250; if (x + 450 > Width) { y = y + 250; x = 10; } } //private void numericUpDown2_ValueChanged(object sender, EventArgs e) { //label2.Text = ( eda.price * count).ToString(); // Font = new Font("Microsoft Sans Serif", Convert.ToInt32(kolvo.Text)); } int Time1 = 0; int Time228 = Environment.TickCount; if (Time228 - Time1 > 20) { // button4.Visible = false; foreach (KeyValuePair <Food, int> eda1 in Продукты.korz228) { Food eda = eda1.Key; int count = eda1.Value; label2.Text = (eda.price * count).ToString(); //подсчет итоговой цены } } label2.Text = prices.ToString(); }