Hi Tamar,
This is still unique only to Native mode right?
I'm just wondering why use this though? OLEDragDrop and OLEDragOver will manage non-OLE data. And then you get none of these anaomolies. (I have discovered that's why I'm not seeing the issue you have).
In a textbox class add this code to OLEDragDrop:
Code:
LPARAMETERS oDataObject, nEffect, nButton, nShift, nXCoord, nYCoord
NODEFAULT
This.Value = ALLTRIM(oDataObject.GetData(1))
*
This.Value = CHRTRAN(This.Value,CHR(10),"")
and in the OLEDragOver add this code:
Code:
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
No you can drag and drop text from one text box to another (or edit box, or combo, etc, anywhere you select text, then drag and drop it). This is what I use for non-ole data.
In addition, I have these three properties set as follows:
OLEDragMode - 1 Automatic
OLEDropMode = 1 Enabled
OLEDropTextInsertion - 1 insert at word boundaries only
OLEDropEffects = 3 (This is 1+2 for nDropEffect value I believe this is the default)
I then have 0 need for "Native" drag/drop support, and I have none of the display issues you are finding.
Now, I know your intention is for demoning this at SWFox, but it may be something you want to mention there is no need for "native" support, and by using the OLEDragDrop for everything it simplifies the code, and you don't have all these weird visual issues your facing.
Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS
"Everything should be made as simple as possible, and no simpler."
![[hammer] [hammer] [hammer]](/data/assets/smilies/hammer.gif)