property Items.ItemWindowHostCreateStyle(Item as HITEM) as Long

Retrieves or sets a value that indicates a combination of window styles used to create the ActiveX window host.

Item as HITEM A long expression that indicates the handle of the item that was previously created by InsertControlItem method.
Long A long value that indicates the container window's style.

The ItemWindowHostCreateStyle property specifies the window styles of the ActiveX's container window, when a new ActiveX control is inserted using the InsertControlItem method. The ItemWindowHostCreateStyle property has no effect for non ActiveX items. The ItemWindowHostCreateStyle property must be called during the AddItem event, like in the following samples. Generally, the ItemWindowHostCreateStyle property is useful to include WS_HSCROLL and WS_VSCROLL styles for a IWebBrowser control ( WWW browser control ), to include scrollbars in the browsed web page.

Some of ActiveX controls requires additional window styles to be added to the container window. For instance, the Web Brower added by the G2antt1.Items.InsertControlItem(, "") won't add scroll bars, so you have to do the following:

First thing is to declare the WS_HSCROLL and WS_VSCROLL constants at the top of your module:

Private Const WS_VSCROLL = &H200000
Private Const WS_HSCROLL = &H100000

Then you need to to insert a Web control use the following lines:

Dim hWeb As HITEM
hWeb = G2antt1.Items.InsertControlItem(, "")
G2antt1.Items.ItemHeight(hWeb) = 196

Next step is adding the AddItem event handler:

Private Sub G2antt1_AddItem(ByVal Item As EXG2ANTTLibCtl.HITEM)
    If (G2antt1.Items.ItemControlID(Item) = "") Then
        ' Some of controls like the WEB control, requires some additional window styles ( like WS_HSCROLL and WS_VSCROLL window styles )
        ' for the window that host that WEB control, to allow scrolling the web page
        G2antt1.Items.ItemWindowHostCreateStyle(Item) = G2antt1.Items.ItemWindowHostCreateStyle(Item) + WS_HSCROLL + WS_VSCROLL
    End If
End Sub
ItemOLEEvent2.jpg (22680 bytes)