Click here to Skip to main content
15,899,013 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to change form property to be change during running app like adding more button text box and shift the location of button, increase size of form
Posted

Nobody prevents you doing it.
Just Googling for would help you on the howto side: "C# programmatically adding controls to a form"[^].
Moving and resizing (even the Form itself) it is just a matter of changing their properties.
 
Share this answer
 
try
Label lbl = new Label();

           for (int x = 0; x <= 3; x++)
           {
               //create new label location after each loop
               //by multiplying the new value of variable x by 5, so the new label
               //control will not overlap each other.
               lbl.Location = new System.Drawing.Point(52 + (x * 5), 58 + (x * 5));
               //create new id and text of the label
               lbl.Name = "label_" + x.ToString();
               lbl.Text = "Label " + x.ToString();

               this.panel1.Controls.Add(lbl);
           }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900