How to set focus to a textbox in page in a AxWebBrowser control? thanks

D

davidw

I put a AxWebBrowser control into a window, I want a textbox in the page
that control call to be focused, if I call the webpage directly, I can see
the textbox is the focused one, but when I call it in the AxWebBrowser
control, the textbox is not set to be focused. what can I do for this?

thanks!
 
C

Cor Ligthert [MVP]

David,

You can set the tabindex from it to 0 if you want it to be the one which has
focus forever at startup.

I hope this helps,

Cor
 
C

Cor Ligthert [MVP]

David,

What do you mean with this sentence
but when I call it in the AxWebBrowser control,

Do you mean that you have dragged the textbox in the AxWebBrowser Control?

Cor
 
A

Armoghan Asif

In axWebBrowser1_DocumentComplete event do something like
you can click by using something like ..Similarly you can do using other
functions like foucs

HTMLDocument myDoc = (HTMLDocument) axWebBrowser1.Document;
HTMLInputElement btnSearch = (HTMLInputElement) myDoc.all.item("btnI",
0);
btnSearch.click();
 

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