Q:

sendkeys.send("{Tab}") does'nt work on command button in vb.net 2015

I am developing a POS in vb.net and want to use Enter key as tab. this works well in controls other than button. e.g when the focus is on textbox or combobox etc then it works good but if the focused control is button then it does not move to next control. Help me by fixing this problem, I have searched alot but could not find any solution regarding this.
thanks
Regards
Muhammad Irfan Sumra

A:

Enter key for button have default behavior which raise Click event.
You can handle Click event for moving focus to next control, and use MouseClick event for your click logic
Private Sub MyButton_Click() Handles MyButton.Click
    SendKeys.Send("{TAB}")
End Sub

Private Sub MyButton_MouseClick() Handles MyButton.MouseClick
    ' Do your click logic
End Sub

