private void ajánlatokToolStripMenuItem_Click(object sender, EventArgs e) { OffersForm offersForm = new OffersForm(shop, this); Hide(); offersForm.ShowDialog(); Show(); }
public PhoneControl(Phone phone, OffersForm offersForm, Panel panel, int y) { this.phone = phone; this.offersForm = offersForm; int posX = BASE_POS_X; int basePosY = y * SPACING_Y; int posY = 0; name = new Label(); name.Text = phone.name; name.Width = 250; name.Font = new Font(Label.DefaultFont, FontStyle.Bold); posY = basePosY + (SPACING_Y - name.Size.Height) / 2; name.Location = new Point(posX, posY); panel.Controls.Add(name); posX += 260; description = new Label(); description.Text = phone.description; description.Width = 230; description.AutoSize = false; description.Height = 60; description.BackColor = Color.Silver; description.TextAlign = ContentAlignment.MiddleCenter; posY = basePosY; description.Location = new Point(posX, posY); panel.Controls.Add(description); posX += 250; price = new Label(); price.Text = phone.price.ToString("#,##0 Ft"); price.Width = 60; posY = basePosY + (SPACING_Y - price.Size.Height) / 2; price.Location = new Point(posX, posY); panel.Controls.Add(price); posX += 70; orderCount = new TextBox(); orderCount.Width = 60; posY = basePosY + (SPACING_Y - orderCount.Size.Height - 10) / 2; orderCount.Location = new Point(posX, posY); panel.Controls.Add(orderCount); posX += 70; db = new Label(); db.Text = "db"; db.Width = 20; posY = basePosY + (SPACING_Y - db.Size.Height) / 2; db.Location = new Point(posX, posY); panel.Controls.Add(db); }