Delete warning with bindingnavigator
When i press the delete button it comes up with prompt do i want to delete but if i click no it deletes anyway here is my codevb.net Code:
Private Sub BindingNavigatorDeleteItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorDeleteItem.Click ''Delete current record after confirming. 'Dim deleteDialogResult As DialogResult 'Dim test As New System.ComponentModel.CancelEventArgs 'With Me ' If .BindingNavigatorDeleteItem.Text = "&Delete" Then ' deleteDialogResult = MessageBox.Show("Delete this record?", "Confirm Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) ' If deleteDialogResult = Windows.Forms.DialogResult.No Then ' ' MessageBox.Show("No Deletion Screen will close", "No Deletion", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) ' 'Me.Close() ' e.EventsArgs.RejectChanges() ' End If ' End If 'End With end sub




Reply With Quote