C# Form focus and Alt-Tab

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
 
J

justin creasy

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.
 
A

alex77ander77

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??
 
A

alex77ander77

Yeah, I had to get the htmlDocument from the AxWebBrowser and then do
a focus on the document, thanks!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top