Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我创建了类,我需要在其中按名称查找 TextBox。我正在使用它,但这里有一个问题,命名空间中不存在 FindName。
object component = this.FindName(componentName); TextBox child = component as TextBox;
我可以在课堂上使用 FindName 方法吗?
您应该使用this.FindControl(当然,`this' 是可选的)。
this.FindControl