Panel中动态生成N个TextBox,怎样在窗体中获取焦点TextBox?

不要告诉偶这样
for (int i = 0; i < Panel.Controls.Count; i++)
{
if (Panel.Controls[i].Focused)
{
//
}
}
[144 byte] By [hcaihao-影子男孩] at [2008-1-9]
# 1
this.ActiveControl
# 2
LZ你觉得你的方法不好吗?
winner2050-winner at 2007-10-19 > top of Msdn China Tech,.NET技术,C#...
# 3
//控制焦点
private void Get_Focus(string sControlID)
{
Page.RegisterStartupScript("focus", "<script>document.all." + sControlID + ".focus();</script>");
}

这样,作为函数
tcxx2008-爱上.Net at 2007-10-19 > top of Msdn China Tech,.NET技术,C#...
# 4
try..

if (this.ActiveControl.GetType().FullName =="System.Windows.Forms.TextBox")
{
//操作
((TextBox)this.ActiveControl).Text = "haha";
}
liujia_0421-SnowLover at 2007-10-19 > top of Msdn China Tech,.NET技术,C#...
# 5
我就是不想用循环,浪费系统资源,我是做CE上的软件,要效率呀,还有,.Net CF里没有this.ActiveControl
hcaihao-影子男孩 at 2007-10-19 > top of Msdn China Tech,.NET技术,C#...