Strange graphical effect in Drag And Drop

M

MySelf

Hello,

I am working on a Winforms application, and implementing a drag and
drop between a treeview and a RTF textbox.

Everything works fine, except that when I drag a string (I mean text)
from the treeview to the textbox and drop it on the textbox, the string
I dropped is displayed in black over orange, until I drop another
string. Then the first string does not appear anymore, but the new one
is displayed in black over orange, somewhere on the textbox.

Note that it does not prevent me from recoverng the value dropped in my
code, by the mean of e.Data.GetDataPresent(DataFormats.Text);

I'd like to be able to remove this graphical effect so this display
does not appear anymore. How can I achieve that ? Is the some property
on the RTF textbox to avoid this effect ?

Thank you.
 
M

MySelf

MySelf a formulé la demande :

I noticed also that while the string value is displayed in black on
orange, I can drag & drop a different string from the treeview, I get
in fact the same Node selected in the treeview, so the same string is
dropped on the textbox. I have to click once on the treeview to make
the graphical effect disappear, so I can really select another node.

For example :

- I drag & drop the "STRING 1" value from Treeview to Textbox. The
value "STRING 1" is inserted in the Textbox, but I get also this text
displayed in black on orange somewhere on the textbox.

- I drag & drop another string ("TRING 2") : the value inserted is
"STRING 1"

- I click once on the treeview, then select a different node and drop
it on Textbox : everything work well.

But I still don't know how to make it work without having to click on
treeview.
 
M

MySelf

MySelf a utilisé son clavier pour écrire :
Hello,

I am working on a Winforms application, and implementing a drag and drop
between a treeview and a RTF textbox.

Everything works fine, except that when I drag a string (I mean text) from
the treeview to the textbox and drop it on the textbox, the string I dropped
is displayed in black over orange, until I drop another string. Then the
first string does not appear anymore, but the new one is displayed in black
over orange, somewhere on the textbox.

Note that it does not prevent me from recoverng the value dropped in my code,
by the mean of e.Data.GetDataPresent(DataFormats.Text);

I'd like to be able to remove this graphical effect so this display does not
appear anymore. How can I achieve that ? Is the some property on the RTF
textbox to avoid this effect ?

Thank you.

A collegue of mine says that it look like the Drag&Drop operation is
not completed, so the item is still displayed in black on orange,
waiting for the operation to end.

Do I need to do something to end the operation, after DragDrop event is
fired ?

Thank you.
 
M

MySelf

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top