Public Class arindv
    Private v_EnterToTab As Boolean = True
    Private v_DeleteKey As Boolean = True

    Public Event EditControl_Keydown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)


#Region " {Enter} Keyboard Override "

    ''' <summary>
    ''' 엔터키처리 오버라이드
    ''' </summary>
    ''' <param name="keyData"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Protected Overrides Function ProcessDialogKey(ByVal keyData As Windows.Forms.Keys) As Boolean
        If v_EnterToTab AndAlso keyData = Windows.Forms.Keys.Enter Then
            MyBase.ProcessTabKey(Windows.Forms.Keys.Tab)
            Return True
        End If
        Return MyBase.ProcessDialogKey(keyData)
    End Function

    ''' <summary>
    ''' 엔터키처리오버라이드
    ''' </summary>
    ''' <param name="e"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Protected Overrides Function ProcessDataGridViewKey(ByVal e As Windows.Forms.KeyEventArgs) As Boolean
        If e.KeyCode = Windows.Forms.Keys.Enter Then
            MyBase.ProcessTabKey(Windows.Forms.Keys.Tab)
            Return True
        End If
        Return MyBase.ProcessDataGridViewKey(e)
    End Function
#End Region

   
    ''' <summary>
    ''' 현재 셀을 삭제할것인지?
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    <System.ComponentModel.Description("뷰에서 발생하는 메세지를 표시할 라벨입니다.")> _
    Public Property A_DelCurrentCell() As Boolean
        Get
            Return Me.v_DeleteKey
        End Get
        Set(ByVal value As Boolean)
            Me.v_DeleteKey = value
        End Set
    End Property


    ''' <summary>
    ''' 엔터키를 누를때 탭키를 발생합니다
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    <System.ComponentModel.Description("엔터키를 누를때 탭키를 발생합니다")> _
    Public Property A_EnterToTab() As Boolean
        Get
            Return Me.v_EnterToTab
        End Get
        Set(ByVal value As Boolean)
            Me.v_EnterToTab = value
        End Set
    End Property

    Private Sub arindv_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
        Select Case e.KeyCode

            Case Windows.Forms.Keys.Delete
                'MsgBox(Me.CurrentCellAddress.ToString, MsgBoxStyle.Information, Me.CurrentCell.Value)
                If e.Shift Then
                    Me.Rows.Remove(Me.CurrentRow)   '//줄삭제
                Else
                    If v_DeleteKey AndAlso Me.RowCount > 0 Then Me.CurrentCell.Value = DBNull.Value
                End If

        End Select
    End Sub

End Class
