就如delphi中的FindComponent
  for i := 1 to 9 do 
    begin
    with TEdit(FindComponent('kh'+IntToStr(i))) do
    begin
      Left := 10;
      Top := i * 20;
      text:='';
    end;
  end;
   这样可以利用循环读取或给它们赋值。

解决方案 »

  1.   

    Dim FormControl As Control
    FormControl = Me.FindControl("Form1");'一般是Form1,根据你的Form名称改吧。
    Dim ChildElement As Control
    For Each ChildElement In FormControl.Children
       If ChildElement.GetType.ToString = "System.Web.UI.WebControls.TextBox" Then '这里是你需要的类型字符串,如System.Web.UI.WebControls.TextBox
          With CType(ChildElement,TextBox)
             .Style("left") = "10"
             .Style("Top") = "20"
             .Text = ""
          End With
       End IF
    Next
      

  2.   

    勿忘国耻 抵制日货&up
      

  3.   

    Dim Obj As Object
       For Each Obj In Me.Controls(1).Controls
           Select Case Obj.GetType.ToString
                Case "System.Web.UI.WebControls.TextBox"
                     Select Case Obj.ID
                         Case "textbox1"                      Case "Textbox2"                      Case Else                    End Select
                End Select
            Next
      

  4.   

    CheckBox oCheckBox = new CheckBox();
    foreach(DataListItem oDataListItem  in DataList1.Items)
    {
    oCheckBox = (CheckBox)oDataListItem.FindControl("CheckBox1");
    if(oCheckBox)
    {
    //
                                             Lable youLaib =  (Lable)oDataListItem.FindControl("Lable111");         
     youLaib .Text = "roapzone"; }
    }