private void treeView_Apps_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
if (MessageBox.Show("确定要安装此APP吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
{
//MessageBox.Show("1234");
if (e.Node.Tag is App)
{
treeView1.SelectedNode = e.Node;
App app = e.Node.Tag as App;
Button a = new Button();
this.flowLayoutPanel1.Controls.Add(a);
a.Text = app.AppName;
a.Tag = app.AppAddress;
a.MouseClick += new MouseEventHandler(botton_MouseClick);
a.Size = new System.Drawing.Size(66, 66);
a.UseVisualStyleBackColor = true;
}
}
}
private void botton_MouseClick(object sender, MouseEventArgs e)
{
}
这是部分代码,上面的代码是一个动态添加botton的事件,然后给botton绑定一个点击事件,下面的事件想要用到上面的botton的一些属性,该怎么弄啊,不会了,求大神
没看懂,请原谅我,我是小白
本回答被提问者和网友采纳