Retrieves or sets a value that indicates a combination of window styles used to create the ActiveX window host.
Type | Description | |||
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 has no effect for regular items. ItemWindowHostCreateStyle property must be change in the AddItem event.
Some of ActiveX controls requires additional window styles to be added to the conatiner window. For instance, the Web Brower added by the Group.Items.InsertControlItem(, "https://www.exontrol.com") 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 = Group.Items.InsertControlItem(, "https://www.exontrol.com") Group.Items.ItemHeight(hWeb) = 196
Next step is adding the AddItem event handler:
Private Sub ExplorerTree1_AddItem(ByVal Group As EXPLORERTREELibCtl.IGroup, ByVal Item As EXPLORERTREELibCtl.HITEM) If (Group.Items.ItemControlID(Item) = "https://www.exontrol.com") 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 Group.Items.ItemWindowHostCreateStyle(Item) = Group.Items.ItemWindowHostCreateStyle(Item) + WS_HSCROLL + WS_VSCROLL End If End Sub