private void button1_Click(object sender, EventArgs e) { if (textBox1.Text != null) { Comment comment1 = new Comment(textBox1.Text, News.id, ID); comment1.Add(comment1); this.panel1.Controls.Clear(); comments = comment1.queryNewId(News.id); foreach (var item in comments) { commenf childform = new commenf(item); childform.TopLevel = false; childform.FormBorderStyle = FormBorderStyle.None; childform.Dock = DockStyle.Top; panel1.Controls.Add(childform); childform.BringToFront(); childform.Show(); } this.textBox1.Text = null; } }
public CommentForm(News news, long id) { this.ID = id; this.News = news; InitializeComponent(); this.SizeChanged += new Resize(this).Form1_Resize; Comment comment = new Comment(); this.panel1.Controls.Clear(); comments = comment.queryNewId(news.id); foreach (var item in comments) { commenf childform = new commenf(item); childform.TopLevel = false; childform.FormBorderStyle = FormBorderStyle.None; childform.Dock = DockStyle.Top; panel1.Controls.Add(childform); childform.BringToFront(); childform.Show(); } }