2
我正在以编程方式向表单添加按钮,出于某种原因,我无法单击它。为什么不?无法以编程方式点击添加按钮
private Button btnBrowser = new Button();
this.btnBrowser.Text = "Open Browser";
this.btnBrowser.Location = new System.Drawing.Point(55, 45);
this.btnBrowser.Size = new System.Drawing.Size(70, 30);
这会将按钮添加到窗体,但我无法单击它。
private void btnBrowser_Click(object sender, EventArgs e)
{
MessageBox.Show("test");
}