> >
> >
> > you want to drag & drop a bomb into my listbox.its normal it is "anti bomb" :-U
> > I tried to use a textbox but unsuccessfully. If you have a solution...thanks in advance.
> >
> > Dont rate please.its only for the pleasure to help.Give me only a feed back.
> > Yousfi Benameur
>
> To fix this error,just add this code to your Form::OleDragDrop event:
>
>
oDataObject.GetData(15, @aValues )
> If EMPTY(aValues) &&<------------------------this is new
> Return
> Endif &&<-------------------- End of new code
> For i = 1 To Alen(aValues)
>
>
> and make the list look like a proper listbox.
>
> Resize it, and AutoHideScrollbar = 0
>
> Now that was much easier to do with a .scx than a prg.
>
> Bernard
>

>
** If you see someone without a smile, give em one of yours :) **>
My Blog
for replacing the listbox by a textbox its done with :
text1.init
this.oledragMode=1 &&automatic
this.oleDropEffects=3
this.OleDropMode=1 && actived mandatory
text1.dragDrop
LPARAMETERS oDataObject, nEffect, nButton, nShift, nXCoord, nYCoord
LOCAL aValues, i, cText, nOperation
Thisform.LockScreen = .T.
DIMENSION aValues[1]
oDataObject.GetData(15, @aValues )
*-- Add picture as a new item in the textbox
FOR i = 1 to alen(aValues)
if inlist(lower(justext(aValues[m.i])),"jpg","bmp","gif","png")
xval=(aValues[m.i] )
This.value=xval
thisform.label1.caption=xval
thisform.ypict=xval
thisform.image1.picture=xval
thisform.image1.visible=.t.
wait window (xval) timeout 0.5
else
thisform.ypict=""
thisform.image1.visible=.f.
thisform.label1.caption=""
endi
NEXT
Thisform.LockScreen = .F.
*-- Set the nEffect parameter for communication back to the source object
nEffect = nOperation
and text1.oleDragover
LPARAMETERS oDataObject, nEffect, nButton, nShift, nXCoord, nYCoord, nState
DO CASE
CASE nState == 0 &&DRAG_ENTER
DO CASE
CASE oDataObject.GetFormat("OLE Variant Array") && Array
This.OLEDropHasData = 1 &&DROPHASDATA_USEFUL
This.OLEDropEffects = 1+2 &&DROPEFFECT_COPY + DROPEFFECT_MOVE
CASE oDataObject.GetFormat(1) && Text
This.OLEDropHasData = 1 &&DROPHASDATA_USEFUL
This.OLEDropEffects = 1+2 &&DROPEFFECT_COPY + DROPEFFECT_MOVE
CASE oDataObject.GetFormat(15) && Files CF_HDROP
This.OLEDropHasData = 1 &&DROPHASDATA_USEFUL
This.OLEDropEffects = 4 &&DROPEFFECT_LINK
OTHERWISE
This.OLEDropHasData = 0 &&DROPHASDATA_NOTUSEFUL
ENDCASE
CASE nState == 1 && Drag Leave
CASE nState == 2 && Drag Over
ENDCASE
tested and works.I add the new zip at the thread end.
Dont rate please.its only for the pleasure to help.Give me only a feed back.
Yousfi Benameur