public RohstoffpreiseForm(int sid, int lev) { InitializeComponent(); lbl_ueberschrift.Font = Grafik.GetStandardFont(Grafik.GetSchriftgRiesig()); level = lev; GlobalAktiveStadt = sid; lbl_ueberschrift.Text = "Rohstoffpreise in " + SW.Dynamisch.GetStadtwithID(GlobalAktiveStadt).GetGebietsName(); lbl_ueberschrift.Left = (this.Width - lbl_ueberschrift.Width) / 2; for (int i = 1; i < SW.Statisch.GetMaxRohID(); i++) { // Bild laden if (Grafik.GetRohstoffIcons80px().Count >= i) { this.Controls["btn_" + i.ToString()].BackgroundImage = Grafik.GetRohstoffIcons80px()[i]; ttRohstoffe.SetToolTip(this.Controls["btn_" + i.ToString()], SW.Dynamisch.GetRohstoffwithID(i).GetRohName()); } // Preis laden this.Controls["lbl_" + i.ToString()].Text = SW.Dynamisch.GetStadtwithID(GlobalAktiveStadt).GetRohstoffPreisVonIDX(i).ToString(); this.Controls["lbl_" + i.ToString()].Left = this.Controls["btn_" + i.ToString()].Left + (this.Controls["btn_" + i.ToString()].Width - this.Controls["lbl_" + i.ToString()].Width) / 2; } }
public RohstoffWaehlen(int r1, int r2) { InitializeComponent(); roh1 = r1; roh2 = r2; if (Grafik.GetRohstoffIcons80px().Count >= r1) { this.Controls["btn_roh1"].BackgroundImage = Grafik.GetRohstoffIcons80px()[r1]; ttRohstoffe.SetToolTip(this.Controls["btn_roh1"], SW.Dynamisch.GetRohstoffwithID(r1).GetRohName()); } if (Grafik.GetRohstoffIcons80px().Count >= r2) { this.Controls["btn_roh2"].BackgroundImage = Grafik.GetRohstoffIcons80px()[r2]; ttRohstoffe.SetToolTip(this.Controls["btn_roh2"], SW.Dynamisch.GetRohstoffwithID(r2).GetRohName()); } }