Browser with Url entry box : WebBrowser « GUI Windows Forms « C# / CSharp Tutorial

Home
C# / CSharp Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statement
5.String
6.struct
7.Class
8.Operator Overload
9.delegate
10.Attribute
11.Data Structure
12.Assembly
13.Date Time
14.Development
15.File Directory Stream
16.Preprocessing Directives
17.Regular Expression
18.Generic
19.Reflection
20.Thread
21.I18N Internationalization
22.LINQ
23.GUI Windows Forms
24.Windows Presentation Foundation
25.Windows Communication Foundation
26.Workflow
27.2D
28.Design Patterns
29.Windows
30.XML
31.XML LINQ
32.ADO.Net
33.Network
34.Directory Services
35.Security
36.unsafe
C# / C Sharp
C# / C Sharp by API
C# / CSharp Open Source
C# / CSharp Tutorial » GUI Windows Forms » WebBrowser 
23.34.2.Browser with Url entry box
Browser with Url entry box
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net;

public class BrowserWithUrlEntryBox
{
    [STAThread]
    static void Main()
    {
        Application.EnableVisualStyles();
        Application.Run(new Form1());
    }
}

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    private void goButton_Click(object sender, EventArgs e)
    {

        ftpBrowser.Navigate(addressBox.Text);

    }
}
partial class Form1
{
    /// <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.ftpBrowser = new System.Windows.Forms.WebBrowser();
        this.label1 = new System.Windows.Forms.Label();
        this.addressBox = new System.Windows.Forms.TextBox();
        this.goButton = new System.Windows.Forms.Button();
        this.SuspendLayout();
        // 
        // ftpBrowser
        // 
        this.ftpBrowser.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.ftpBrowser.Location = new System.Drawing.Point(1642);
        this.ftpBrowser.Margin = new System.Windows.Forms.Padding(4444);
        this.ftpBrowser.Name = "ftpBrowser";
        this.ftpBrowser.Size = new System.Drawing.Size(917524);
        this.ftpBrowser.TabIndex = 4;
        // 
        // label1
        // 
        this.label1.AutoSize = true;
        this.label1.Location = new System.Drawing.Point(1511);
        this.label1.Margin = new System.Windows.Forms.Padding(4040);
        this.label1.Name = "label1";
        this.label1.Size = new System.Drawing.Size(6017);
        this.label1.TabIndex = 1;
        this.label1.Text = "Address";
        // 
        // addressBox
        // 
        this.addressBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                    | System.Windows.Forms.AnchorStyles.Right)));
        this.addressBox.Location = new System.Drawing.Point(777);
        this.addressBox.Margin = new System.Windows.Forms.Padding(4444);
        this.addressBox.Name = "addressBox";
        this.addressBox.Size = new System.Drawing.Size(57222);
        this.addressBox.TabIndex = 2;
        // 
        // goButton
        // 
        this.goButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
        this.goButton.Location = new System.Drawing.Point(6595);
        this.goButton.Margin = new System.Windows.Forms.Padding(4444);
        this.goButton.Name = "goButton";
        this.goButton.Size = new System.Drawing.Size(10028);
        this.goButton.TabIndex = 3;
        this.goButton.Text = "Go";
        this.goButton.Click += new System.EventHandler(this.goButton_Click);
        // 
        // Form1
        // 
        this.AutoScaleDimensions = new System.Drawing.SizeF(8F16F);
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
        this.ClientSize = new System.Drawing.Size(949581);
        this.Controls.Add(this.goButton);
        this.Controls.Add(this.addressBox);
        this.Controls.Add(this.label1);
        this.Controls.Add(this.ftpBrowser);
        this.Margin = new System.Windows.Forms.Padding(4444);
        this.Name = "Form1";
        this.Text = "Form1";
        this.ResumeLayout(false);
        this.PerformLayout();

    }

    #endregion

    private System.Windows.Forms.WebBrowser ftpBrowser;
    private System.Windows.Forms.Label label1;
    private System.Windows.Forms.TextBox addressBox;
    private System.Windows.Forms.Button goButton;
}
23.34.WebBrowser
23.34.1.A simple BrowserA simple Browser
23.34.2.Browser with Url entry boxBrowser with Url entry box
23.34.3.Online Book Browser
23.34.4.Simpel Web Browser with forward, backward buttonSimpel Web Browser with forward, backward button
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.