I have added one button in designer.cs file and second button creating runtime on first button click. Tell me on which thread button1 and button2 created
- using System;
- using System.Drawing; using System.Windows.Forms;
- namespace WinformTest {public partial class Form1 : Form{public Form1()
- {
- InitializeComponent();
- //button1 added at designer.cs
- }
- private void button1_Click(object sender, EventArgs e)
- {
- //Dynamically creating button2.
- Button button2 = new Button();
- button2.Location = new Point(112, 33);
- button2.Name = "button2";
- button2.Size = new Size(78, 33);
- button2.TabIndex = 1;
- button2.Text = "button2";
- }

Kiran MohantyRank #821 · 2.8K reputationPosted Nov 24, 2020, 10:01 PM EST
Sachin SinghRank #66 · 26.2K reputationPosted Nov 24, 2020, 10:37 PM EST
Patel73 reputationPosted Nov 25, 2020, 2:44 AM EST