Azad Chouhan
Azad Chouhan

Reputation: 275

how to convert string data to html in richtextbox

I am fetching the response using httpwebrequest in winform now i want to display it as html page in my winform for this i am using richtextbox but it is simply displaying me text not html please tell me how can do it here is my code for this

     Uri uri = new Uri("http://www.google.com");
     if (uri.Scheme == Uri.UriSchemeHttp) {
        HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri);
        request.Method = WebRequestMethods.Http.Get;
        HttpWebResponse response = (HttpWebResponse)request.GetResponse();
        StreamReader reader = new StreamReader(response.GetResponseStream());
        string tmp = reader.ReadToEnd();
        richTextBox1.Text = tmp;
     }

Upvotes: 1

Views: 2893

Answers (1)

Vishal Kottarathil
Vishal Kottarathil

Reputation: 346

There is a .Net control which allows editing of html in winforms,

Take a look http://winformhtmltextbox.codeplex.com/

Upvotes: 0

Related Questions