Solved

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

Posted on 2009-03-31
4
1,242 Views
Last Modified: 2013-12-17
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
Comment
Question by:ehmf
4 Comments
 
LVL 19

Expert Comment

by:daveamour
ID: 24027219
What is it you are after - ie what is the "text" ?
0
 
LVL 2

Expert Comment

by:Causality
ID: 24027415
how you want to select the text ?
via code ?
Can you explain your question ?
0
 
LVL 15

Accepted Solution

by:
jinal earned 500 total points
ID: 24707420
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question