【发布时间】:2014-07-06 14:12:46
【问题描述】:
好的,没有解释清楚,如何在所有表单上搜索控件名称?
` void No1(Form a, int x, int y)
{
No2(a, x, y);
}
void No2(Form a, int x, int y)
{
Button b1 = new Button();
b1.Location = new Point(x, y);
b1.Click += new EventHandler(b1_click);
b1.Name = "OgO4sEVm6asqnw";
a.Controls.Add(b1);
}
void b1_click(object sender, EventArgs e)
{
a.Controls.RemoveByKey("OgO4sEVm6asqnw");
No1(a, x, y); //I have no way to get a, x and y,
//since I don't know on witch form b1 is
}`
希望这能更好地解释它..
【问题讨论】:
-
很难从巨大的文本块中解析出你想要做什么。你能重新格式化,提供一个例子,也许是一些示例代码或伪代码?