sabato 30 agosto 2014

C#: aggiunta di una label a un form a runtime.

    class Modificatore
    {

        public static void modifica(Form Frm)
        {
            Label lbl = new Label();
            Frm.Controls.Add(lbl);
            lbl.Text = "CIAO";
            lbl.AutoSize = false;
            lbl.BorderStyle = BorderStyle.FixedSingle;
            lbl.BackColor = Color.White;
            lbl.Location = new Point(100, 100);
            lbl.Width = 200;
            lbl.Height = 100;
            lbl.Visible = true;

        }
        
    }

Nessun commento:

Posta un commento