That Asian Guy
9th December 2007, 20:43
i made a web browser :P
Here it is
It has no functions, such as back etc, but it loads uber quick.
Source Code:
#pragma once
namespace AsianWebBrowser {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
/// <summary>
/// Summary for Form1
///
/// WARNING: If you change the name of this class, you will need to change the
/// 'Resource File Name' property for the managed resource compiler tool
/// associated with all .resx files this class depends on. Otherwise,
/// the designers will not be able to interact properly with localized
/// resources associated with this form.
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::WebBrowser^ webBrowser1;
protected:
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::Label^ label1;
private: System::Windows::Forms::TextBox^ textBox1;
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;
#pragma 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>
void InitializeComponent(void)
{
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(F orm1::typeid));
this->webBrowser1 = (gcnew System::Windows::Forms::WebBrowser());
this->button1 = (gcnew System::Windows::Forms::Button());
this->label1 = (gcnew System::Windows::Forms::Label());
this->textBox1 = (gcnew System::Windows::Forms::TextBox());
this->SuspendLayout();
//
// webBrowser1
//
this->webBrowser1->Anchor = static_cast<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->webBrowser1->Location = System::Drawing::Point(12, 39);
this->webBrowser1->MinimumSize = System::Drawing::Size(20, 20);
this->webBrowser1->Name = L"webBrowser1";
this->webBrowser1->Size = System::Drawing::Size(682, 413);
this->webBrowser1->TabIndex = 0;
this->webBrowser1->Url = (gcnew System::Uri(L"http://www.msn.com", System::UriKind::Absolute));
this->webBrowser1->Navigated += gcnew System::Windows::Forms::WebBrowserNavigatedEventHa ndler(this, &Form1::webBrowser1_Navigated);
//
// button1
//
this->button1->Location = System::Drawing::Point(660, 10);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(34, 23);
this->button1->TabIndex = 1;
this->button1->Text = L"GO";
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System::Drawing::Point(12, 15);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(35, 13);
this->label1->TabIndex = 2;
this->label1->Text = L"URL :";
//
// textBox1
//
this->textBox1->Location = System::Drawing::Point(53, 10);
this->textBox1->Name = L"textBox1";
this->textBox1->Size = System::Drawing::Size(601, 20);
this->textBox1->TabIndex = 3;
this->textBox1->KeyDown += gcnew System::Windows::Forms::KeyEventHandler(this, &Form1::textBox1_KeyDown);
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(706, 464);
this->Controls->Add(this->textBox1);
this->Controls->Add(this->label1);
this->Controls->Add(this->button1);
this->Controls->Add(this->webBrowser1);
this->Icon = (cli::safe_cast<System::Drawing::Icon^ >(resources->GetObject(L"$this.Icon")));
this->Name = L"Form1";
this->Text = L"Asian Web Browser";
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)
{
if ( !this->textBox1->Text->Equals( "" ) )
{
this->webBrowser1->Navigate( this->textBox1->Text );
}
}
private: System::Void textBox1_KeyDown(System::Object^ sender, System::Windows::Forms::KeyEventArgs^ e)
{
if ( e->KeyCode == System::Windows::Forms::Keys::Enter && !this->textBox1->Text->Equals( "" ) )
{
this->webBrowser1->Navigate( this->textBox1->Text );
}
}
private: System::Void webBrowser1_Navigated(System::Object^ sender, System::Windows::Forms::WebBrowserNavigatedEventAr gs^ e)
{
this->textBox1->Text = this->webBrowser1->Url->ToString();
}
};
}
Here it is
It has no functions, such as back etc, but it loads uber quick.
Source Code:
#pragma once
namespace AsianWebBrowser {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
/// <summary>
/// Summary for Form1
///
/// WARNING: If you change the name of this class, you will need to change the
/// 'Resource File Name' property for the managed resource compiler tool
/// associated with all .resx files this class depends on. Otherwise,
/// the designers will not be able to interact properly with localized
/// resources associated with this form.
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::WebBrowser^ webBrowser1;
protected:
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::Label^ label1;
private: System::Windows::Forms::TextBox^ textBox1;
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;
#pragma 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>
void InitializeComponent(void)
{
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(F orm1::typeid));
this->webBrowser1 = (gcnew System::Windows::Forms::WebBrowser());
this->button1 = (gcnew System::Windows::Forms::Button());
this->label1 = (gcnew System::Windows::Forms::Label());
this->textBox1 = (gcnew System::Windows::Forms::TextBox());
this->SuspendLayout();
//
// webBrowser1
//
this->webBrowser1->Anchor = static_cast<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->webBrowser1->Location = System::Drawing::Point(12, 39);
this->webBrowser1->MinimumSize = System::Drawing::Size(20, 20);
this->webBrowser1->Name = L"webBrowser1";
this->webBrowser1->Size = System::Drawing::Size(682, 413);
this->webBrowser1->TabIndex = 0;
this->webBrowser1->Url = (gcnew System::Uri(L"http://www.msn.com", System::UriKind::Absolute));
this->webBrowser1->Navigated += gcnew System::Windows::Forms::WebBrowserNavigatedEventHa ndler(this, &Form1::webBrowser1_Navigated);
//
// button1
//
this->button1->Location = System::Drawing::Point(660, 10);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(34, 23);
this->button1->TabIndex = 1;
this->button1->Text = L"GO";
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System::Drawing::Point(12, 15);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(35, 13);
this->label1->TabIndex = 2;
this->label1->Text = L"URL :";
//
// textBox1
//
this->textBox1->Location = System::Drawing::Point(53, 10);
this->textBox1->Name = L"textBox1";
this->textBox1->Size = System::Drawing::Size(601, 20);
this->textBox1->TabIndex = 3;
this->textBox1->KeyDown += gcnew System::Windows::Forms::KeyEventHandler(this, &Form1::textBox1_KeyDown);
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(706, 464);
this->Controls->Add(this->textBox1);
this->Controls->Add(this->label1);
this->Controls->Add(this->button1);
this->Controls->Add(this->webBrowser1);
this->Icon = (cli::safe_cast<System::Drawing::Icon^ >(resources->GetObject(L"$this.Icon")));
this->Name = L"Form1";
this->Text = L"Asian Web Browser";
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)
{
if ( !this->textBox1->Text->Equals( "" ) )
{
this->webBrowser1->Navigate( this->textBox1->Text );
}
}
private: System::Void textBox1_KeyDown(System::Object^ sender, System::Windows::Forms::KeyEventArgs^ e)
{
if ( e->KeyCode == System::Windows::Forms::Keys::Enter && !this->textBox1->Text->Equals( "" ) )
{
this->webBrowser1->Navigate( this->textBox1->Text );
}
}
private: System::Void webBrowser1_Navigated(System::Object^ sender, System::Windows::Forms::WebBrowserNavigatedEventAr gs^ e)
{
this->textBox1->Text = this->webBrowser1->Url->ToString();
}
};
}