How to give line break in panel in C# Windows application?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajeshk
    New Member
    • May 2013
    • 2

    How to give line break in panel in C# Windows application?

    Hello All,

    I am creating windows application in that i wan create dynamic controls so that i want to give line break after each control in panel.I had tried

    panel1.Controls .Add(new LiteralControl( "<BR>"));

    but it gives error like :
    "The type or namespace name 'LiteralControl ' could not be found (are you missing a using directive or an assembly reference?)"
    Also have tried adding namespace for leteral control bt it not accepting.VS10 automaticaly get restart if i trying to add system.web.dll
  • M1kkelZU
    New Member
    • Feb 2013
    • 80

    #2
    What about Enviroment.NewL ine(); ?

    Comment

    • vijay6
      New Member
      • Mar 2010
      • 158

      #3
      Hey rajeshk, you can use location property. For example if you want to add two controls (two pictureboxes) one below another at run-time in your form then you can use like as follows.

      Code:
      pictureBox1.Location = new Point(12, 12);
      pictureBox2.Location = new Point(12, pictureBox1.Location.Y + pictureBox1.Height + 10);

      Comment

      Working...