If e.keyCode = Keys.Enter AndAlso e.Table.Cols(e.Table.colSel).Name = "SN" Then
e.cancel = True
Dim r As Row = e.Table.addnew
If r IsNot Nothing Then
e.Table.Select(r.Index, 0)
e.Table.StartEditing
End If
End If
If e.keyCode = Keys.Enter AndAlso e.Table.Cols(e.Table.colSel).Name = "SN" Then
e.cancel = True
e.Table.addnew
End If
DataColChanging
Dim kwbm As WinForm.TextBox = e.Form.Controls("TextBox1")
If e.DataCol.Name = "SN" Then
If e.NewValue.contains("KW") Then
kwbm.text = e.NewValue
e.DataRow.Delete
e.DataRow.save
Else
Dim str As String = e.NewValue.Replace(chr(10), "").Replace(chr(13), "")
Dim idx1 As Integer = str.IndexOf("MAC:")
Dim idx2 As Integer = str.IndexOf("H/W:")
Dim length As Integer
If str.Contains("SN:") Then
length = IIF(idx1 <> -1,idx1-3,IIF(idx2 <> -1,idx2-4,str.Length - 3))
e.NewValue = str.SubString(3, length)
Else
e.NewValue =str
End If
If str.Contains("MAC:") Then
If idx2 = -1 Then
e.DataRow("MAC") = str.SubString(idx1+4)
Else
e.DataRow("MAC") = str.SubString(idx1+4, idx2-idx1-4)
End If
End If
If str.Contains("H/W:") Then
e.DataRow("HW") = str.substring(idx2+4)
End If
End If
End If
e.Form.TimerEnabled = False
e.Form.Controls("Table1").Select
e.Form.Controls("Table1").Table.Focus
e.Form.Controls("Table1").Table.StartEditing
e.Form.TimerInterval = 1000
e.Form.TimerEnabled = True
为什么扫了二维码只出现1行?
二维码内容
SN:00252202360 MAC:98:45:62:32:fa:f0
SN:00252202416 MAC:98:45:62:32:fe:70
SN:00252202315 MAC:98:45:62:32:f8:20
SN:00252201886 MAC:98:45:62:32:dd:50
SN:00252202453 MAC:98:45:62:40:00:c0
SN:00252202757 MAC:98:45:62:40:13:c0
SN:00252202815 MAC:98:45:62:40:17:60
SN:00252202298 MAC:98:45:62:32:f7:10
SN:00252202113 MAC:98:45:62:32:eb:80
SN:00252202075 MAC:98:45:62:32:e9:20
SN:00252202801 MAC:98:45:62:40:16:80
SN:00252202226 MAC:98:45:62:32:f2:90
SN:00252202799 MAC:98:45:62:40:16:60
SN:00252202802 MAC:98:45:62:40:16:90
SN:00252201898 MAC:98:45:62:32:de:10
SN:00252202621 MAC:98:45:62:40:0b:40
SN:00252202724 MAC:98:45:62:40:11:b0
SN:00252202588 MAC:98:45:62:40:09:30
SN:00252202785 MAC:98:45:62:40:15:80
SN:00252202150 MAC:98:45:62:32:ed:d0