L LeeM Member Licensed User Longtime User Oct 17, 2013 #1 I'm asking this here as I'm sure there are some great .net programmers around these parts. I'm creating a 'remote control' app using B4A and the Bluetooth tutorial (my tablet controls a vb.net app). I press a button on my tablet and the corresponding Button_Click event is fired in my vb.net app. Code: Copy Call NextGameButton_Click(Me, EventArgs.Empty) Everything is working great so far but occasionally a MessageBox is shown in the .net app. and I need to click the Yes/No or OK button (via remote control) but I don't know how to do this in .net as there are no click events. Can anyone offer any solutions ?
I'm asking this here as I'm sure there are some great .net programmers around these parts. I'm creating a 'remote control' app using B4A and the Bluetooth tutorial (my tablet controls a vb.net app). I press a button on my tablet and the corresponding Button_Click event is fired in my vb.net app. Code: Copy Call NextGameButton_Click(Me, EventArgs.Empty) Everything is working great so far but occasionally a MessageBox is shown in the .net app. and I need to click the Yes/No or OK button (via remote control) but I don't know how to do this in .net as there are no click events. Can anyone offer any solutions ?
Erel B4X founder Staff member Licensed User Longtime User Oct 17, 2013 #2 You can probably use SendKeys to send Enter or Escape: http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.aspx Upvote 0
You can probably use SendKeys to send Enter or Escape: http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.aspx
L LeeM Member Licensed User Longtime User Oct 19, 2013 #3 Thanks, that pointed me in the right direction. For anyone else who's interested the code is Code: Copy My.Computer.Keyboard.SendKeys("~", True) 'Enter key for MessageBoxs with just OK as a response and Code: Copy My.Computer.Keyboard.SendKeys("Y", True) My.Computer.Keyboard.SendKeys("N", True) for Yes/No response. Upvote 0
Thanks, that pointed me in the right direction. For anyone else who's interested the code is Code: Copy My.Computer.Keyboard.SendKeys("~", True) 'Enter key for MessageBoxs with just OK as a response and Code: Copy My.Computer.Keyboard.SendKeys("Y", True) My.Computer.Keyboard.SendKeys("N", True) for Yes/No response.