C# Programming
09-01-2009, 05:39 PM
Hello,
i am using a webbrowser control on my form together with textboxes. What i need is that when i load the form the cursor will be in textbox, but instead the webbrowser "steals focus". I have tried using the Focus() property for the textbox in just about anywhere now but it still wont work. Also i have tried creating event handlers for webbrowser's different events (GotFocus, Validated etc) but nothing seems to work.
The only thing that worked was the DocumentCompleted handler, which can make the cursor go to the textbox but not when the form loads, which is strange, since i have the browser go to a web page when the form loads (after InitializeComponent).
TY
i am using a webbrowser control on my form together with textboxes. What i need is that when i load the form the cursor will be in textbox, but instead the webbrowser "steals focus". I have tried using the Focus() property for the textbox in just about anywhere now but it still wont work. Also i have tried creating event handlers for webbrowser's different events (GotFocus, Validated etc) but nothing seems to work.
The only thing that worked was the DocumentCompleted handler, which can make the cursor go to the textbox but not when the form loads, which is strange, since i have the browser go to a web page when the form loads (after InitializeComponent).
TY