在昨天发的例子中插入下面的程序
Private Sub mrMit05_CellValidating(ByVal sender As Object, ByVal e As GrapeCity.Win.MultiRow.CellValidatingEventArgs) Handles mrMit05.CellValidating
'ピリオド入力の処理
Sub_PeriodCheck(sender, e)
End Sub
Private Sub Sub_PeriodCheck(ByVal sender As Object, ByRef e As GrapeCity.Win.MultiRow.CellValidatingEventArgs)
Try
Dim strName As String = DirectCast(sender, Control).Name
Dim strGyo As Integer = e.RowIndex
Dim strValue As String = String.Empty
Dim strCode As String = String.Empty
Dim strPreCode As String = String.Empty
Dim strPreFax As String = String.Empty
Dim strPreShiTan As String = String.Empty
Dim strValueP As Object = mrMit05.GetValue(e.RowIndex, e.CellIndex)
If mrMit05(e.RowIndex, e.CellIndex).Name = "txt_SHO_NAME" Or _
mrMit05(e.RowIndex, e.CellIndex).Name = "txt_KIKAKI" Or _
mrMit05(e.RowIndex, e.CellIndex).Name = "txt_SHIKEY" Or _
mrMit05(e.RowIndex, e.CellIndex).Name = "cmb_SHINAME" Or _
mrMit05(e.RowIndex, e.CellIndex).Name = "txt_SHIFAXNO" Or _
mrMit05(e.RowIndex, e.CellIndex).Name = "txt_SHITAN" Or _
mrMit05(e.RowIndex, e.CellIndex).Name = "txt_KOBETUNOKI" Or _
mrMit05(e.RowIndex, e.CellIndex).Name = "txt_MEISAIBIKO" Then
If mrMit05.GetValue(e.RowIndex, e.CellIndex) Is "." Or mrMit05.GetValue(e.RowIndex, e.CellIndex) Is "." Then
'1行目はエラー
If e.RowIndex = 0 Then
MessageBox.Show("1行目でピリオドは入力できません")
e.Cancel = True
Exit Sub
Else
'前行コピー
mrMit05.SetValue(e.RowIndex, e.CellIndex, mrMit05.GetValue(e.RowIndex - 1, e.CellIndex))
End If
End If
End If
Catch ex As Exception
End Try
End Sub
昨天试验的可以实现,早上不知怎么了,就是不成功,不好意思,
拜托你再帮检查一下吧。 |