work with webBrowser properties?
-
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.
-
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.
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.
-
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.
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.
-
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.
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);
-
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);
-
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.
Guess I should have mentioned that. Well good to hear you got it working.