<< Click to Display Table of Contents >>
Script to Create Objects in a Grid |
The next script references an hpXContainer object and creates up to 9 (nine) objects of type hpLinkIcon, placing them on the grid defined in an hpXGridCalc object. When reaching the limit of objects, these are deleted and the counting is then restarted.
Sub hpCommandButton1_OnEventClick()
Set Container = Screen.Item("hpXContainer1")
With Container
'Deletes objects from the grid
'and restarts counting in the Index property
If .Index > (.Columns * .Rows) Then .Reset = True
'Creates an hpLinkIcon-type object
'already placed on the grid
.ClassName = "hpLinkIcon" 'Class of the object
.CreateNewObject = True 'Creates the object
End With
End Sub