level 1
baron0041
楼主
代码是如下所示:
For Each ctl As Control In Controls
Select Case ctl.Name.Substring(0,2)
Case "txt","cmb","dtp"
Dim str数组 As String = ctl.Name.Substring(3)
ds内存.Tables(dgv区域.DataMember).Rows(dgv区域.CurrentRow.Index)(str字段名)=ctl.Text
End Select
Next
我看书上有个例子将其中的ctl全部改为了controls(i),还要定义个变量i。。。
是这样吗?求高人。。谢谢
2012年05月19日 06点05分
1
For Each ctl As Control In Controls
Select Case ctl.Name.Substring(0,2)
Case "txt","cmb","dtp"
Dim str数组 As String = ctl.Name.Substring(3)
ds内存.Tables(dgv区域.DataMember).Rows(dgv区域.CurrentRow.Index)(str字段名)=ctl.Text
End Select
Next
我看书上有个例子将其中的ctl全部改为了controls(i),还要定义个变量i。。。
是这样吗?求高人。。谢谢