1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
panel1.AutoScroll = true;
//reponse est un DataTable qui contient dans mon cas 4 rows
for (int i = 0; i < reponse.Rows.Count; i++)
{
Label label1 = new System.Windows.Forms.Label();
Label label2 = new System.Windows.Forms.Label();
Label label3 = new System.Windows.Forms.Label();
Label label4 = new System.Windows.Forms.Label();
Label label5 = new System.Windows.Forms.Label();
RichTextBox richTextBox1 = new System.Windows.Forms.RichTextBox();
// label1
//
label1.AutoSize = true;
label1.Location = new System.Drawing.Point(31, 40);
label1.Name = "label1";
label1.Size = new System.Drawing.Size(35, 13);
label1.TabIndex = 0;
label1.Text = reponse.Rows[i].Field<String>("idlogin");
//
// richTextBox1
//
richTextBox1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
richTextBox1.Location = new System.Drawing.Point(162, 71);
richTextBox1.Name = "richTextBox1";
richTextBox1.ReadOnly = false;
richTextBox1.Size = new System.Drawing.Size(344, 104);
richTextBox1.TabIndex = 1;
richTextBox1.Text = reponse.Rows[i].Field<String>("commentaire");
//
// label2
//
label2.AutoSize = true;
label2.Location = new System.Drawing.Point(31, 90);
label2.Name = "label2";
label2.Size = new System.Drawing.Size(105, 13);
label2.TabIndex = 2;
label2.Text = "Date de publication :";
//
// label3
//
label3.AutoSize = true;
label3.Location = new System.Drawing.Point(31, 132);
label3.Name = "label3";
label3.Size = new System.Drawing.Size(35, 13);
label3.TabIndex = 3;
label3.Text = "label3";
//
// label4
//
label4.AutoSize = true;
label4.Location = new System.Drawing.Point(159, 40);
label4.Name = "label4";
label4.Size = new System.Drawing.Size(40, 13);
label4.TabIndex = 4;
label4.Text = "Sujet : ";
//
// label5
//
label5.AutoSize = true;
label5.Location = new System.Drawing.Point(242, 40);
label5.Name = "label5";
label5.Size = new System.Drawing.Size(35, 13);
label5.TabIndex = 5;
label5.Text = "label5";
panel1.Controls.Add(label1);
panel1.Controls.Add(label4);
panel1.Controls.Add(label5);
panel1.Controls.Add(richTextBox1);
panel1.Controls.Add(label2);
panel1.Controls.Add(label3);
} |
Partager