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
                DataGridView3.Rows.Clear()
                DataGridView3.Columns.Clear()
            End If

        End If
    End Sub

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

Categories

%d bloggers like this: