ObjectID

<< Click to Display Table of Contents >>

Navigation:  Clickable Objects >

ObjectID

Previous pageReturn to chapter overviewNext page

[GUI Control Only, Professional Edition and above]

Defines an Object ID that will be assigned to the next object(s), that are inserted into the document. With the Object ID you are able to identify a clicked object later when showing the preview. When the user clicks onto such an object with an assigned ID, the DoObjectClicked (VCL: OnObjectClicked, .NET: ObjectClicked) event is sent together with the Object ID to your application.

The Object ID may have any value that can be represented with a long integer. The Object ID has to be different from 0 (zero). Setting the Object ID to zero means, that the object is not clickable.

property long VPE.ObjectID

read / write; runtime only

Possible Values:

an Object ID to identify the clicked object when processing the DoObjectClicked() event (VCL: OnObjectClicked(), .NET: ObjectClicked())

Default:

0

Remarks:

You may assign one and the same Object ID to any number of objects. It is the whole responsibility of your application, how it will work with Object ID's.

 

The following objects can be assigned an Object ID (and therefore can be made clickable):

Box

Ellipse

Pie

Print(-Box)

Write(-Box)

Picture

Barcodes (1D and 2D)

RTF

Charts

UDO

FormField

Remarks:

You can read the value of this property. It is only accessible for reading while your application is processing the event DoObjectClicked() (VCL: OnObjectClicked(), .NET: ObjectClicked()). Reading this property while not processing the event will return invalid - and therefore useless - data.

Example:

Doc.ObjectID = 1

Doc.Print(1, 1, "Monthly Report")

Assigns the ObjectID 1 to the text object "Monthly Report".

 

Doc.ObjectID = 2

Doc.Picture(1, 1, 3, 3, "data.bmp")

Assigns the ObjectID 2 to the image "data.bmp".

 

Doc.ObjectID = 0

Doc.Print(1, Doc.nBottom + 30, "This image shows data.")

Assigns NO ObjectID to the text object "This image shows data.". Therefore this object is not clickable.

 

Processing of the  DoObjectClicked() event in Visual Basic:

Private Sub Doc_DoObjectClicked(ByVal ObjectID As Long)

 MsgBox "Object #" + Str(ObjectID) + "was clicked"

End Sub

The event handler in the example above will show a message box with the Object ID of the clicked object.