Req: How to use enter key for result and clear field
This is the code for the search command when hitting the button
Code:
Private Sub btnMobileDeviceFilter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMobileDeviceFilter.Click
ds.Tables(0).DefaultView.RowFilter = "[Mobile_Phone_Type] like '%" & tbMobileDevice.Text & "%'"
DataGridView1.DataSource = ds.Tables(0)
End Sub
If I double click the field and add
Code:
ds.Tables(0).DefaultView.RowFilter = "[Mobile_Phone_Type] like '%" & tbMobileDevice.Text & "%'"
DataGridView1.DataSource = ds.Tables(0)
When I enter text it locates the desired findings.
Also how can I create a button to execute to clear the field of the box?
Thank you
Re: Req: How to use enter key for result and clear field
Code:
tbMobileDevice.Text = ""
Re: Req: How to use enter key for result and clear field
Yeah I just worked that out myself as well. Thank you.
Re: Req: How to use enter key for result and clear field
If you by your first question means that you want the code for your btnMobileDeviceFilter to run when you hit the enter key then simply make the it the default button. In the Form designer select your Form and set the AcceptButton property to the btnMobileDeviceFilter button.