Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. work with webBrowser properties?

work with webBrowser properties?

Scheduled Pinned Locked Moved C#
htmlhelpquestion
6 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mr mohsen
    wrote on last edited by
    #1

    hi friends i want to use a one richtextbox and one webbrowser instead of a html/text editor because i dednt find any editor control that can be used in windows application, i try to change "DocumentText" property of webBrowser control and set it with richtextbox value when user press specify button but in first time below code works correctly but in next times this property of webBrowser has not changed!!! do u know why? please tell me the solution webBrowser1.DocumentText = richTextBox1.Text;

    nobody help you... you have to help you yourself and this is success way.

    A 1 Reply Last reply
    0
    • M mr mohsen

      hi friends i want to use a one richtextbox and one webbrowser instead of a html/text editor because i dednt find any editor control that can be used in windows application, i try to change "DocumentText" property of webBrowser control and set it with richtextbox value when user press specify button but in first time below code works correctly but in next times this property of webBrowser has not changed!!! do u know why? please tell me the solution webBrowser1.DocumentText = richTextBox1.Text;

      nobody help you... you have to help you yourself and this is success way.

      A Offline
      A Offline
      Adam R Harris
      wrote on last edited by
      #2

      Hello Mr. Mohsen, I replied to your original post. but you should use the WebBrowser.Document.Body.InnerHtml to set the HTML of the document.

      M 1 Reply Last reply
      0
      • A Adam R Harris

        Hello Mr. Mohsen, I replied to your original post. but you should use the WebBrowser.Document.Body.InnerHtml to set the HTML of the document.

        M Offline
        M Offline
        mr mohsen
        wrote on last edited by
        #3

        oh no man i test your code and the result is like previouse code in other hand both code have same result and in first time work correctly and in next times does not work please check it to understand the problem thank you

        nobody help you... you have to help you yourself and this is success way.

        A 1 Reply Last reply
        0
        • M mr mohsen

          oh no man i test your code and the result is like previouse code in other hand both code have same result and in first time work correctly and in next times does not work please check it to understand the problem thank you

          nobody help you... you have to help you yourself and this is success way.

          A Offline
          A Offline
          Adam R Harris
          wrote on last edited by
          #4

          This is very strange because i just created a new project and am not experiencing your issue. here is the sample code from my windows forms test. public class Form1 : Form { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.webBrowser1 = new System.Windows.Forms.WebBrowser(); this.button1 = new System.Windows.Forms.Button(); this.textBox1 = new System.Windows.Forms.TextBox(); this.button2 = new System.Windows.Forms.Button(); this.SuspendLayout(); // // webBrowser1 // this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Bottom; this.webBrowser1.Location = new System.Drawing.Point(0, 127); this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20); this.webBrowser1.Name = "webBrowser1"; this.webBrowser1.Size = new System.Drawing.Size(461, 257); this.webBrowser1.TabIndex = 0; // // button1 // this.button1.Dock = System.Windows.Forms.DockStyle.Top; this.button1.Location = new System.Drawing.Point(0, 0); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(461, 23); this.button1.TabIndex = 1; this.button1.Text = "button1"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // textBox1 // this.textBox1.Location = new System.Drawing.Point(22, 30);

          M 1 Reply Last reply
          0
          • A Adam R Harris

            This is very strange because i just created a new project and am not experiencing your issue. here is the sample code from my windows forms test. public class Form1 : Form { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.webBrowser1 = new System.Windows.Forms.WebBrowser(); this.button1 = new System.Windows.Forms.Button(); this.textBox1 = new System.Windows.Forms.TextBox(); this.button2 = new System.Windows.Forms.Button(); this.SuspendLayout(); // // webBrowser1 // this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Bottom; this.webBrowser1.Location = new System.Drawing.Point(0, 127); this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20); this.webBrowser1.Name = "webBrowser1"; this.webBrowser1.Size = new System.Drawing.Size(461, 257); this.webBrowser1.TabIndex = 0; // // button1 // this.button1.Dock = System.Windows.Forms.DockStyle.Top; this.button1.Location = new System.Drawing.Point(0, 0); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(461, 23); this.button1.TabIndex = 1; this.button1.Text = "button1"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // textBox1 // this.textBox1.Location = new System.Drawing.Point(22, 30);

            M Offline
            M Offline
            mr mohsen
            wrote on last edited by
            #5

            thank you my friend your code work correctly the problem is i didnt call navigate methode of webBrowser with about:blank value parameter thank you very mutch

            nobody help you... you have to help you yourself and this is success way.

            A 1 Reply Last reply
            0
            • M mr mohsen

              thank you my friend your code work correctly the problem is i didnt call navigate methode of webBrowser with about:blank value parameter thank you very mutch

              nobody help you... you have to help you yourself and this is success way.

              A Offline
              A Offline
              Adam R Harris
              wrote on last edited by
              #6

              Guess I should have mentioned that. Well good to hear you got it working.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups