Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1248
  • 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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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