-- 给文本框赋值不成工
Dim tb10 As WinForm.TextBox = e.Form.Controls("TextBox10")
Dim cb2 As WinForm.ComboBox = e.Form.Controls("ComboBox2")
Dim t1 As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim t2 As WinForm.TextBox = e.Form.Controls("TextBox2")
Dim t3 As WinForm.TextBox = e.Form.Controls("TextBox3")
Dim t4 As WinForm.TextBox = e.Form.Controls("TextBox4")
Dim t5 As WinForm.TextBox = e.Form.Controls("TextBox5")
Dim t6 As WinForm.TextBox = e.Form.Controls("TextBox6")
Dim t7 As WinForm.TextBox = e.Form.Controls("TextBox7")
Dim t8 As WinForm.TextBox = e.Form.Controls("TextBox8")
Dim t9 As WinForm.TextBox = e.Form.Controls("TextBox9")
Dim tem As String = tb10.Text
Dim temp() As String = tem.Split(" ")
If tb10.text.Trim <>"" Then
Tables("buyerdz").AddNew
Select Case cb2.Text.Trim
Case "中信"
msgbox (temp.Length)
If temp.Length>1 Then
msgbox (temp(0))
t1.Text=temp(0)
t2.Text=temp(1)
t3.Text=temp(2)
t4.Text=temp(3)
t5.Text=temp(4)
t6.Text=temp(5)
If temp.Length>6 Then
t7.Text=temp(6)
End If
If temp.Length>7 Then
t8.Text=temp(7)
End If
If temp.Length>8Then
t9.Text=temp(8)
End If
Else
messagebox.Show("字符串异常,无法自动录入.请重新输入(或手动录入)","提示")
End If
Case "交行"
If temp.Length>8 Then
t1.Text=temp(0)
t3.Text=temp(1)
t7.Text=temp(2)
t8.Text=temp(3)
t9.Text=temp(4)
t4.Text=temp(5)
t5.Text=temp(6)
t8.Text=temp(7)
t9.Text=temp(8)
Else
messagebox.Show("字符串异常,无法自动录入.请重新输入(或手动录入)","提示")
End If
End Select
End If
在加一个问题 让文本框得到焦点是 全选