Click here to Skip to main content
15,881,413 members
Articles / Desktop Programming / Win32

Creating a Facebook Like Website Previewer

Rate me:
Please Sign up or sign in to vote.
4.50/5 (8 votes)
2 Apr 2012CPOL6 min read 42.1K   1.4K   27  
How to create a Facebook like website previewer user control for Winforms in C#
namespace HtmlSitePreviewerDemo
{
    partial class MainForm
    {
        /// <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.label1 = new System.Windows.Forms.Label();
            this.txtUrl = new System.Windows.Forms.TextBox();
            this.btnPreview = new System.Windows.Forms.Button();
            this.udImages = new System.Windows.Forms.NumericUpDown();
            this.label2 = new System.Windows.Forms.Label();
            this.lblNumberImages = new System.Windows.Forms.Label();
            this.htmlSitePreviewer1 = new HtmlSitePreviewer.HtmlSitePreviewer();
            ((System.ComponentModel.ISupportInitialize)(this.udImages)).BeginInit();
            this.SuspendLayout();
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(35, 41);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(69, 13);
            this.label1.TabIndex = 0;
            this.label1.Text = "Enter a URL:";
            // 
            // txtUrl
            // 
            this.txtUrl.Location = new System.Drawing.Point(106, 39);
            this.txtUrl.Name = "txtUrl";
            this.txtUrl.Size = new System.Drawing.Size(325, 20);
            this.txtUrl.TabIndex = 1;
            // 
            // btnPreview
            // 
            this.btnPreview.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.btnPreview.Location = new System.Drawing.Point(436, 37);
            this.btnPreview.Name = "btnPreview";
            this.btnPreview.Size = new System.Drawing.Size(75, 23);
            this.btnPreview.TabIndex = 2;
            this.btnPreview.Text = "Preview!";
            this.btnPreview.UseVisualStyleBackColor = true;
            this.btnPreview.Click += new System.EventHandler(this.BtnPreviewClick);
            // 
            // udImages
            // 
            this.udImages.Location = new System.Drawing.Point(256, 185);
            this.udImages.Minimum = new decimal(new int[] {
            1,
            0,
            0,
            0});
            this.udImages.Name = "udImages";
            this.udImages.Size = new System.Drawing.Size(41, 20);
            this.udImages.TabIndex = 4;
            this.udImages.Value = new decimal(new int[] {
            1,
            0,
            0,
            0});
            this.udImages.ValueChanged += new System.EventHandler(this.UdImagesValueChanged);
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(187, 187);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(68, 13);
            this.label2.TabIndex = 5;
            this.label2.Text = "Image Index:";
            // 
            // lblNumberImages
            // 
            this.lblNumberImages.AutoSize = true;
            this.lblNumberImages.Location = new System.Drawing.Point(188, 212);
            this.lblNumberImages.Name = "lblNumberImages";
            this.lblNumberImages.Size = new System.Drawing.Size(96, 13);
            this.lblNumberImages.TabIndex = 6;
            this.lblNumberImages.Text = "Number of Images:";
            // 
            // htmlSitePreviewer1
            // 
            this.htmlSitePreviewer1.BackColor = System.Drawing.Color.Transparent;
            this.htmlSitePreviewer1.ImageIndex = 1;
            this.htmlSitePreviewer1.Location = new System.Drawing.Point(38, 65);
            this.htmlSitePreviewer1.Name = "htmlSitePreviewer1";
            this.htmlSitePreviewer1.ShowLoadingStatus = true;
            this.htmlSitePreviewer1.Size = new System.Drawing.Size(393, 110);
            this.htmlSitePreviewer1.TabIndex = 3;
            this.htmlSitePreviewer1.UserAgent = "Mozilla/5.0 (Windows NT 5.1; rv:6.0) Gecko/20100101 Firefox/6.0 FirePHP/0.6";
            // 
            // MainForm
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.Color.WhiteSmoke;
            this.ClientSize = new System.Drawing.Size(539, 244);
            this.Controls.Add(this.lblNumberImages);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.udImages);
            this.Controls.Add(this.btnPreview);
            this.Controls.Add(this.htmlSitePreviewer1);
            this.Controls.Add(this.txtUrl);
            this.Controls.Add(this.label1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.MaximizeBox = false;
            this.Name = "MainForm";
            this.Text = "Html Site Previewer Demo";
            ((System.ComponentModel.ISupportInitialize)(this.udImages)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.TextBox txtUrl;
        private HtmlSitePreviewer.HtmlSitePreviewer htmlSitePreviewer1;
        private System.Windows.Forms.Button btnPreview;
        private System.Windows.Forms.NumericUpDown udImages;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label lblNumberImages;
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer http://www.icemanind.com
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions