If e.sender.name Like "cplx" Then
For Each ctl As WinForm.Control In e.Form.Controls \'遍历所有控件
Dim cmb As WinForm.ComboBox
If TypeOf ctl Is WinForm.ComboBox Then
cmb = e.Form.Controls(ctl.Name)
Dim str As String =e.Form.Controls("cplx").Value
If str = Nothing Then
cmb.ComboList = Nothing
Else
If ctl.Name Like "bwmc*" Then
cmb.ComboList = DataTables("字典").GetComboListString(str & "_部位名称", str & "_部位名称 is not null")
ElseIf ctl.Name Like "fjxx*" Then
cmb.ComboList = DataTables("字典").GetComboListString(str & "_辅件_名称", str & "_辅件_名称 is not null")
End If
End If
End If
Next
ElseIf e.sender.name Like "fjxx*" Then
Dim str As String =e.Form.Controls("cplx").Value
\'MessageBox.Show(str)
Dim str2 As String ="dw" & e.sender.name.replace("fjxx","")
\'MessageBox.Show(str2)
\'If str = Nothing Then
\' e.Form.Controls(str2).text = Nothing
\' Else
Dim dr As DataRow= DataTables("字典").Find(str & "_辅件_名称 = \'" & e.sender.text & "\'")
\' MessageBox.Show(str & "_辅件_单位")
If dr IsNot Nothing Then
e.Form.Controls(str2).text = dr(str & "_辅件_单位")
End If
\'End If
End If
此主题相关图片如下:jdfw.gif