Waqar Ahmed

Waqar Ahmed

  • NA
  • 3
  • 0

Help Required in Events

Feb 17 2006 7:11 PM
Dear Friends I am the beginner in the C# and currently working on event handling. I have created an array of buttons and placed them on the form. how can I do the event handling in this case for individual button. my code to create buttons is as follow with an array. for (int i = 0; i < num_of_buttons; i++) { for (int j = 0; j < num_of_buttons; j++) { this.b[i, j] = new Button(); this.b[i, j].Name = "B " + m; this.b[i, j].Text = "B " + m; this.b[i, j].Location = new Point(k, l); this.b[i, j].Size = new Size(30, 30); this.b[i, j].TabIndex = m; this.Controls.Add(this.b[i, j]); } } Please help me in solving this problem.

Answers (2)