WebBrowser Component

  • Thread starter Thread starter Roman
  • Start date Start date
R

Roman

I have added a Microsoft Web Browser Component to my
toolbax using 'Cusomize Toolbox'. The component has been
included into the General section of toolbox but it is
grayed out. Anybody knows why?
 
Try putting this code in your Windows Designer's Initialize Component

Use

private AxSHDocVw.AxWebBrowser axWebBrowser1; as your definition.



this.axWebBrowser1 = new AxSHDocVw.AxWebBrowser();

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



//

// axWebBrowser1

//

this.axWebBrowser1.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.axWebBrowser1.Enabled = true;

this.axWebBrowser1.Location = new System.Drawing.Point(0, 72);

this.axWebBrowser1.OcxState =
((System.Windows.Forms.AxHost.State)(resources.GetObject("axWebBrowser1.OcxState")));

this.axWebBrowser1.Size = new System.Drawing.Size(424, 312);

this.axWebBrowser1.TabIndex = 11;

Check your earlier post. I replied with sample code on how to do what you
were asking.

You might need to encapsulate that in a try / catch (Exception ex) {
MessageBox.Show(ex.ToString()); } if youare getting COM errors. also double
check my earlier post
 
I am not sure what the code below means. Do you know why
the WebBrowser item in the toolbox is disabled (grayed
out) and is the code below going to fix it? To put the
code below I need to have a reference to the AxSHDocVw.
This reference is not created since the component in the
tllobox is disapled. Please, advise
 
Back
Top