[dgv_clients_UserDeletingRow]
を使用してイベントを呼び出す問題に直面してい[ContextMenuStrip]
ます。
それは私にそのエラーを与えています:
Unable to cast object of type 'System.EventArgs' to type 'System.Windows.Forms.DataGridViewRowCanelEventArgs'
そして、ここに私のコードがあります:
Private Sub dgv_clients_UserDeletingRow(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewRowCancelEventArgs) Handles dgv_clients.UserDeletingRow
deleteLine(e)
End Sub
Private Sub toolStripItem1_Click(ByVal sender As Object, ByVal args As EventArgs) Handles toolStripItem1.Click
If mouseLocation.RowIndex > 0 Then
dgv_clients.Rows(mouseLocation.RowIndex).Selected = True
dgv_clients.Rows(mouseLocation.RowIndex).DefaultCellStyle.SelectionBackColor = Color.Gray
DeleteToolStripMenuItem_Click(sender, args)
End If
End Sub
Public Sub DeleteToolStripMenuItem_Click(ByVal Sender As Object, ByVal e As EventArgs)
Call deleteLine(e)
End Sub
ありがとうございました