The embedded web browser cannot be docked like a regular dockable control. This is because the docking windows layout initialization attempts to access the web browser’s handle while that control is still in the process of being created which could result in a System.Reflection.TargetInvocationException. This happens with other ActiveX wrappers too. The ActiveX control handle sometimes gets created more than once during initialization and this interferes with the re-parenting that takes place when a dock state is being loaded. An easy workaround to this would be set a panel control as the docking window and use this as a place holder, instead of directly enabling docking on the ActiveX control.
Handle the DockingManager's NewDockStateEndLoad event, parent the ActiveX control to the panel, and set its desired DockStyle value.
private void dockingManager1_NewDockStateEndLoad(object sender, System.EventArgs e)
// panel1 is the docking window and label1 is the HTML control
this.label1.Dock = DockStyle.Fill;
this.axWebBrowser1.Navigate("http://www.syncfusion.com",ref o,ref o,ref o,ref o);
Private Sub dockingManager1_NewDockStateEndLoad(ByVal sender As Object, ByVal e As System.EventArgs)
' panel1 is the docking window and label1 is the HTML control
Dim o As Object = Nothing
Me.label1.Dock = DockStyle.Fill
Me.AxWebBrowser1.Navigate("http://www.syncfusion.com", o, o, o, o)
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|