谢谢……问题已经解决了。 这是公司的解决方案。留着给自己回家了看。=,=还没给测试人员测过不知道对不……
- If e.Col = CST_COL_社内品名コード左 And e.KeyChar <> vbBack And e.KeyChar <> "." Then
- Dim selectLenth As Integer = DirectCast(fxg.Editor, TextBox).SelectionLength
- If GetByteCount(fxg.Editor.Text) + GetByteCount(e.KeyChar) - selectLenth >= 4 Then
- Dim startIndex As Integer = DirectCast(fxg.Editor, TextBox).SelectionStart
- Dim leftStr As String = DirectCast(fxg.Editor, TextBox).Text.Substring(0, startIndex)
- Dim rightStr As String = DirectCast(fxg.Editor, TextBox).Text.Substring(startIndex)
- If (leftStr & e.KeyChar & rightStr).Length > DirectCast(fxg.Editor, TextBox).MaxLength Then
- e.Handled = True
- Return
- End If
- fxg.Editor.Text = leftStr & e.KeyChar & rightStr
- fxg.FinishEditing()
- fxg.Col = fxg.Col + 1
- fxg.StartEditing()
- e.Handled = True
- Return
- End If
- End If
复制代码 |