web browser in a windows form

  • Thread starter Thread starter The Bear
  • Start date Start date
You may want to look into using the shdocvw.dll native COM server as well.

******** RBisch - C# enthusiast
****** ryanbischoff@PLZyahooNO_SPAM.com
:)
 
(1)

C:\>aximp c:\winnt\system32\shdocvw.dll
Generated Assembly: C:\SHDocVw.dll
Generated Assembly: C:\AxSHDocVw.dll


(2) Add reference to AxShDocVw.dll in your windows form project

(3) Use it !

For e.g,


protected AxSHDocVw.AxWebBrowser axWebBrowser;


public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
_is_navigation_i_p = false;

//
// TODO: Add any constructor code after InitializeComponent call
//

// Navigate to the desired url.
object nullobj = null;
//string url =
"http://localhost.us.dell.com/symphony/Start.aspx?"; //homePage;
//string url= ConfigurationSettings.AppSettings[_parentApp.ApplicationName
];

this.axWebBrowser = new AxSHDocVw.AxWebBrowser();
//object opt = this.axWebBrowser.Document;


((System.ComponentModel.ISupportInitialize)(this.axWebBrowser)).BeginInit();

this.axWebBrowser.Enabled = true;

((System.ComponentModel.ISupportInitialize)(this.axWebBrowser)).EndInit();



// Make the browser control fill the entire client area.
axWebBrowser.Dock = DockStyle.Top;
this.Controls.Add( this.axWebBrowser );

// Finally, show the browser control.
this.axWebBrowser.Show();



}


axWebBrowser got methods like .Navigate ...


Cheers
Nirmal
 
Back
Top