Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1252
  • Last Modified:

Web browser control in Visual Studio .Net 2005 (J#)

Hi all

I am using the web browser control in visual studio .net 2005 (J#). I need to select & copy certain text content in the document.

I am using the attached code, but it returns the html source of the document not the text.



String x;
x = webBrowser1.get_DocumentText();
textBox1.set_Text(x);

Open in new window

0
ehmf
Asked:
ehmf
1 Solution
 
daveamourCommented:
What is it you are after - ie what is the "text" ?
0
 
CausalityCommented:
how you want to select the text ?
via code ?
Can you explain your question ?
0
 
jinalCommented:
Hello ,

Try to use following way. I am giving you C# example and it will help you out.

In button click of form.

webBrowser1.Focus();
System.Windows.Form.SendKeys.SendWait("^c");
textbox1.Text = Clipboard.GetText();

To select all text

webBrowser1.Focus();
System.Windows.Form.SendKeys.SendWait("^a^c");
textbox1.Text = Clipboard.GetText();

Let me know if you still have any problem.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now