Author | Topic: Changing a value in an event handler parameter | |
---|---|---|
Salar Madadi | Changing a value in an event handler parameter on Wed, 27 Jan 2010 16:47:12 -0500 Hello Everyone, We are trying to work with an ActiveX component called T-List. This is used to generate a tree of data that will provide a multitude of functionality and provide a simple interface that will allow users to drag and drop the data elsewhere in the Tree. We seem to be having some issues referencing some of the event handlers involved in the drag and drop operations. The difficulty we are having is that the event handler is expecting the cancel value to be passed back but Xbase does not seem to appreciate this regardless of being passed by value or reference. Does anyone know of a way to pass back a value to an OCX event handler or a sufficient work around? I've included the documentation we have on the event below. Thanks. AutoDragRequest Event Description This event is generated just before the drag/drop process starts in AutoDragDrop mode and provides control over initiation of the drag/drop operation. Syntax Sub TList_AutoDragRequest([Index As Integer,], SourceItem As Long, Cancel As Integer) Remarks The AutoDragRequest event syntax has these parts: Part Description Index An integer that uniquely identifies a control if it is in a control array. SourceItem The index of an item being dragged during the operation. Note youcan set this parameter to any valid item index. There is a list of predefined values, which you can use as an index (in multiple selection 192 Properties, events, methods, functions reference Programmer's Guide TList 8 ActiveX Control mode only): -1 drag all items of this tree -2 drag no items (but drag/drop operation will take place anyway) -3 drag all selected items -4 drag selected item Cancel This variable should be set to True to cancel the drag/drop operation. Sample The following example illustrates how to disable drag/drop operations for all root items: Private Sub TList1_AutoDragRequest(SourceItem As Long, Cancel As Integer) If SourceItem >= 0 Then Cancel = IIf(TList1.Shift(SourceItem) = 0, True, False) EndIf ... End Sub |