This documentation is archived and is not being maintained.

OLESetData Event (ActiveX Controls)

Visual Studio .NET 2003

Occurs on a source component when a target component performs the GetData method on the source's DataObject object, but before the data for the specified format has been loaded.


Private Sub object_OLESetData(data As DataObject, dataformat As Integer)

The OLESetData event syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
data A DataObject object in which to place the requested data. The component calls the SetData method to load the requested format.
dataformat An integer specifying the format of the data that the target component is requesting. The source component uses this value to determine what to load into the DataObject object.


In certain cases, you may want to defer loading data into the DataObject object of a source component to save time, especially if the source component supports many formats. This event allows the source to respond to only one request for a given format of data. When this event is called, the source should check the format parameter to determine what needs to be loaded and then perform the SetData method on the DataObject object to load the data which is then passed back to the target component.

See Also

Applies To: Masked Edit Control | MSChart Control