C# Form focus and Alt-Tab

  • Thread starter Thread starter claudioillanes
  • Start date Start date
C

claudioillanes

I'm a beginner with C#. I've got a Forms C# application that has an
AxWebBrowser component embedded. While the C# application runs, a user
is filling out some text boxes in the AxWebBrowser. If they then alt-
tab out and alt-tab back into the C# forms application, their blinking
cursor is no longer there. How can I ensure that if they alt-tab back,
that the AxWebBrowser webpage has it's curser blinking in the place
where they left off?? I get confused with words like focus, activated
etc...

Any help is greatly appreciated!

Alex
 
I'm a beginner with C#. I've got a Forms C# application that has an
AxWebBrowser component embedded. While the C# application runs, a user
is filling out some text boxes in the AxWebBrowser. If they then alt-
tab out and alt-tab back into the C# forms application, their blinking
cursor is no longer there. How can I ensure that if they alt-tab back,
that the AxWebBrowser webpage has it's curser blinking in the place
where they left off?? I get confused with words like focus, activated
etc...

Any help is greatly appreciated!

Alex

I'm guessing you've already been told to put the following line of
code

this.Focus();

in your forms Activated event. If you haven't been told that, that is
one way to solve you problem. If what I just said is what is confusing
you let me know and I can explain how to put that code in your forms
Activated event.
 
In the main form_activated method I've tried:

this.Focus();
and
this.axWebBrowser1.Focus();

but neither is putting the focus on the text box that they left off
at... any other suggestions??
 
Yeah, I had to get the htmlDocument from the AxWebBrowser and then do
a focus on the document, thanks!!!
 
Back
Top