shlomi gadol

shlomi gadol

  • NA
  • 36
  • 55.7k

sending key to webbrowser don't work

May 31 2015 3:43 AM
Hi,
 
I have small C# project with two controls. The first is webbrowser and the second is button. I want to write code which when i click on the button I send keys to the webrowser control.
 
This is my code in the button click function:
 
   webbrowser.select();
   SendKeys.Send("ABC");
  SendKeys.Send("{ENTER}");
 
The problem is that I need to click on webbrowser and then need to click twice on the button in order to send what I wrote.
 
it seems that the select() is executed only when I out from the button_click function.
 
how can I solve this? that once I click on the button the job is done and I will not need to click twice?
 
Thanks
Shlomi
 

Answers (3)