PeterBaileyUk
asked on
vb.net sendkey
I have this which does the search based on a textbox, that works great, ive added an if crossgrid.checked which if true populates the search textbox of another grid. that all goes fine but how do i replicate the pressing of the enter button on TBSearchCommon? tbsearchcommon already has a workable onkeyup event that works I just cannot see how to send an enter key for it.
i tried this but the sendkeys part didnt work
i tried this but the sendkeys part didnt work
Private Shadows Sub OnKeyUp(sender As Object, e As KeyEventArgs) Handles TxtBulkShortDesc.KeyUp
Dim tb = DirectCast(sender, TextBox)
If tb.Equals(TxtBulkShortDesc) Then
If e.KeyCode.Equals(Keys.Enter) Then
If OPCrossGrid.Checked = True Then
TBSearchCommon.Text = tb.Text this part works
'SendKeys.Send("{Enter}") i remmed this out as it didnt work
End If
DataGridViewStringsBulk.SearchAndSelect(tb.Text, CBBulkSearchDesc.SelectedItem, True)
tb.Clear()
e.Handled = True
End If
End If
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I refuse to give myself points so added yours as the best.
your solution worked as well, just different approach cheers
ASKER
Open in new window