0

I am trying to make a sort of notification within my form. The panel will consist of a rich textbox followed by two buttons underneath it.

Design of panel

I would need a way of programatically displaying new panels with different data in each one and having it displayed so that it can be scrolled. Initially, i have tried to create a table layout panel and then a panel. I could not figure out how to create a new instance of the panel i created in designer to place it into the table layout.

If there is another simple way of achieving my goal of having a group of controls being added beneath each other programatically i would appreciate it.

2
  • Look at my answer here : stackoverflow.com/questions/37165402/… Commented Feb 20, 2020 at 12:02
  • Is the question how to add something to TableLayoutPanel in code behind? Commented Feb 20, 2020 at 12:16

1 Answer 1

0

You can use this code to generate dynamic controls, but i am just sharing with you sample code.

 int n = 10; Panel[] p=new Panel[n]; int j = 10; for (int i=0;i<n;i++) { j += 10; p[i] = new Panel(); p[i].BorderStyle = BorderStyle.Fixed3D; p[i].Height = 100; p[i].Location = new Point(100,10+j); this.Controls.Add(p[i]); } 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.