Posted by: Sourav | June 1, 2015

Detect delete on textbox,VB.Net

So what if the user select whole text on the delete textbox and delete iit by pressing delete,I want my datagridview at that very moment to go blank

to do this

    Private Sub TextBox7_KeyUp(sender As Object, e As KeyEventArgs) Handles TextBox7.KeyUp
        If e.KeyCode = Keys.Delete Then
            If TextBox7.Text.Length = 0 Then
                DataGridView3.DataSource = Nothing
            End If

        End If
    End Sub


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


%d bloggers like this: