'看意图,楼主是想输入学生编号后,自动显示学生姓名
'如果是这样的话,textbox1控件valuechanged事件直接写以下代码:
Dim txt As winform.textbox = e.form.controls("textbox2")Dim dr As DataRow = DataTables("stuinfo").find("id = '"& e.sender.value &"'")If dr IsNot Nothing Then txt.value = dr("name")Else txt.value = NothingEnd If