// First resize the form
this->Width = 800; // your size in px
this->Height = 600;
// Second create the WebBrowser
WebBrowser^ wb = gcnew WebBrowser();
wb->Parent = this;
wb->Location = Point(12, 40);
wb->Width = 700;
wb->Height = 500;
wb->ScriptErrorsSuppressed = true;
// Navivate to a website
wb->Navigate("http://www.cplusplus.com/forum/"); // May take a few seconds
The whole code should look like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
private:
System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)
{
// First resize the form
this->Width = 800; // your size in px
this->Height = 600;
// Second create the WebBrowser
WebBrowser^ wb = gcnew WebBrowser();
wb->Parent = this;
wb->Location = Point(12, 40);
wb->Width = 700;
wb->Height = 500;
wb->ScriptErrorsSuppressed = true;
// Navivate to a website
wb->Navigate("http://www.cplusplus.com/forum/"); // May take a while
}
Pretty easy, isn't it. There you easily see the power of .NET.
Sorry for advertising, but I really like it.