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 item's handle that was previously created by InsertControlItem property. | |||
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 ActiveX controls require additional window styles to be added to the conatiner window. For instance, the Web Brower added by the Grid1.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 to insert a Web control use the following lines:
Dim hWeb As HITEM hWeb = Grid1.Items.InsertControlItem(, "https://www.exontrol.com") Grid1.Items.ItemHeight(hWeb) = 196
Next step is adding the AddItem event handler:
Private Sub Grid1_AddItem(ByVal Item As EXGRIDLibCtl.HITEM) If (Grid1.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 Grid1.Items.ItemWindowHostCreateStyle(Item) = Grid1.Items.ItemWindowHostCreateStyle(Item) + WS_HSCROLL + WS_VSCROLL End If End Sub