using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace GenerateHtml
{
    public partial class frm49GenerateHtml : Form
    {
        public frm49GenerateHtml()
        {
            InitializeComponent();
        }

        // Start at home.
        private void frm49GenerateHtml_Load(object sender, EventArgs e)
        {
            displayWebBrowser.GoHome();
            //displayWebBrowser.Navigate("about:blank");
        }

        // Enable the button.
        private void displayWebBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            setContentsButton.Enabled = true;
        }

        // Set the HTML contents.
        private void setContentsButton_Click(object sender, EventArgs e)
        {
            HtmlDocument doc = displayWebBrowser.Document;
            doc.Body.InnerHtml = htmlTextBox.Text;
        }


        /// <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.displayWebBrowser = new System.Windows.Forms.WebBrowser();
            this.setContentsButton = new System.Windows.Forms.Button();
            this.splitContainer1 = new System.Windows.Forms.SplitContainer();
            this.htmlTextBox = new System.Windows.Forms.TextBox();
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
            this.splitContainer1.Panel1.SuspendLayout();
            this.splitContainer1.Panel2.SuspendLayout();
            this.splitContainer1.SuspendLayout();
            this.SuspendLayout();
            // 
            // displayWebBrowser
            // 
            this.displayWebBrowser.Dock = System.Windows.Forms.DockStyle.Fill;
            this.displayWebBrowser.Location = new System.Drawing.Point(0, 0);
            this.displayWebBrowser.MinimumSize = new System.Drawing.Size(20, 20);
            this.displayWebBrowser.Name = "displayWebBrowser";
            this.displayWebBrowser.Size = new System.Drawing.Size(360, 111);
            this.displayWebBrowser.TabIndex = 6;
            this.displayWebBrowser.DocumentCompleted += new System.Windows.Forms.WebBrowserDocumentCompletedEventHandler(this.displayWebBrowser_DocumentCompleted);
            // 
            // setContentsButton
            // 
            this.setContentsButton.Anchor = System.Windows.Forms.AnchorStyles.Top;
            this.setContentsButton.Enabled = false;
            this.setContentsButton.Location = new System.Drawing.Point(152, 12);
            this.setContentsButton.Name = "setContentsButton";
            this.setContentsButton.Size = new System.Drawing.Size(80, 24);
            this.setContentsButton.TabIndex = 8;
            this.setContentsButton.Text = "Set Contents";
            this.setContentsButton.Click += new System.EventHandler(this.setContentsButton_Click);
            // 
            // splitContainer1
            // 
            this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
            | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.splitContainer1.Location = new System.Drawing.Point(12, 42);
            this.splitContainer1.Name = "splitContainer1";
            this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
            // 
            // splitContainer1.Panel1
            // 
            this.splitContainer1.Panel1.Controls.Add(this.htmlTextBox);
            // 
            // splitContainer1.Panel2
            // 
            this.splitContainer1.Panel2.Controls.Add(this.displayWebBrowser);
            this.splitContainer1.Size = new System.Drawing.Size(360, 207);
            this.splitContainer1.SplitterDistance = 92;
            this.splitContainer1.TabIndex = 9;
            // 
            // htmlTextBox
            // 
            this.htmlTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
            this.htmlTextBox.Location = new System.Drawing.Point(0, 0);
            this.htmlTextBox.Multiline = true;
            this.htmlTextBox.Name = "htmlTextBox";
            this.htmlTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
            this.htmlTextBox.Size = new System.Drawing.Size(360, 92);
            this.htmlTextBox.TabIndex = 5;
            this.htmlTextBox.Text = "<HTML>\r\n  <BODY>\r\n    <H1>Hello World!</H1>\r\n    Go to <A HREF=\"http://www.csharp" +
    "helper.com\">C# Helper</A>\r\n  </BODY>\r\n</HTML>";
            // 
            // frm49GenerateHtml
            // 
            this.AcceptButton = this.setContentsButton;
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(384, 261);
            this.Controls.Add(this.setContentsButton);
            this.Controls.Add(this.splitContainer1);
            this.Name = "frm49GenerateHtml";
            this.Text = "GenerateHtml";
            this.Load += new System.EventHandler(this.frm49GenerateHtml_Load);
            this.splitContainer1.Panel1.ResumeLayout(false);
            this.splitContainer1.Panel1.PerformLayout();
            this.splitContainer1.Panel2.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
            this.splitContainer1.ResumeLayout(false);
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.WebBrowser displayWebBrowser;
        internal System.Windows.Forms.Button setContentsButton;
        private System.Windows.Forms.SplitContainer splitContainer1;
        internal System.Windows.Forms.TextBox htmlTextBox;
    }
}