Merci pour le bout de code
mais chez moi (RB 2007 r4 sous Mac OS X) ca marche pas.
!?
Le 26 juin 08 à 17:42, Jean-Luc Arnaud a écrit :
Le 26 juin 08 à 14:28, Arnaud Nicolet a écrit :
Le 26 juin 08 à 13:44 (soir), Nicolas Jullien a écrit:
Je viens de trouver mais alors c'est pas satisfaisant du tout !
http://support.realsoftware.com/listarchives/realbasic-nug/
2007-12/msg00233.html
How to stop an EditField to automatically accept any text
dropped on?
The DropObject event never fires, so I can't control the text
dropped
onto the editField.
This is not a great method, but I'd simply think that if the
text has
changed without a keydown event or the cut/paste/clear menu item
(or
by code), it's a text drop.
I'd make a new class (as EditField) and add a property
(TextWillChange
As Boolean). Then you put "TextWillChange=true" in the menu
handlers
of the cut and paste menu items and in the keydown event (and
anywhere
you change the text in code).
C'est un peu désespérant !
SVP, Real Guys débogez RB !
Bon, je reconnais là l'un de mes anciens messages, désolé que ma
solution ne vous convienne pas.
Comment se fait-il que vous disiez avoir trouvé, mais qu'en même
temps ce n'est pas satisfaisant? Ça veut donc dire que vous
n'avez pas trouvé, j'aurais cru.
J'ai trouvé une des solutions proposées (la votre donc) mais en
meme temps c'est pas satisfaisant car ca montre qu'il s'agit donc
d'un hack/trick mais pas d'une solution propre d'interception de
l'event drag comme on aurait pu l'espérer dans un monde sans bug.
Personnellement, j'utilise ceci :
Dans un EditFiled :
Open : Me.AcceptTextDrop
DragEnter : DropText=obj.Text
DragExit : DropText=""
TextChange :
If DropText<>"" Then
Me.Text=DropText
DropText=""
End If
Cela fonctionne bien (au moins pour mes besoins !)
JLA
|