Property pages can only exist inside a Visual Basic ActiveX control (UserControl) project, although in this case the ActiveX control is not used.
In order for the SubStart control to display additional composite property pages, it must know which property pages to display. Property pages are assigned a unique identifier, or GUID, when created.
Because Visual Basic does not expose this GUID directly, you must find it by examining the registry.
To find your property page in the registry, search for a string consisting of the project name, concatenated with a period and the form name: e.g. VBSubPropPages.SubPage1.
The GUIDs for all your property pages must be supplied to the SubStart control using the sub_PropertyPages function in the class module for the composite control project.
After you find the GUIDs for your property pages, set Binary Compatibility in the project settings to ensure that the GUIDs are not changed.
Property pages for composite controls differ from property pages for other controls in how they save and restore the properties to the control:
The SubStart object is available in the property page using the SelectedControls property and it is used to retrieve and store any properties that should be displayed or set.
The SelectionChanged and ApplyChanges methods are used to transfer the data using the sub_SubDataValue Let and Get functions exported by the control.
When the composite is loaded, the SubStart control loads the properties to the composite by calling the sub_SubDataValue function in the composite class module.
When the property page is first loaded, or when the selected control subsequently changes, the SelectionChanged function in the property page is called.
Here the current property values must be retrieved from the SubStart control and displayed on the page, using the SubProps property of the composite. Remember that properties are identified by index.
EXAMPLE
This example has only one property, called count.
Private Sub PropertyPage_SelectionChanged()
'update our dialog from the first selected
control
'each property should use a different index
Text1.Text = SelectedControls(index).SubProps("count")
Text2.Text = SelectedControls(index).SubProps("delay")
'update other properties here
End Sub
In the property page ApplyChanges function, the data entered is sent to the composite using the SubProps property of the composite.
Private Sub PropertyPage_ApplyChanges()
SelectedControls(index).SubProps("count") = Text1.Text
SelectedControls(index).SubProps("delay") = Text2.Text
'add other properties here...
End Sub