DÉTECTER LE MOT SOUS LA SOURIS SANS CLIQUER (MOUSEOVER) D'UN RICHTEXTBOX
cs_DARKSIDIOUS
Messages postés15814Date d'inscriptionjeudi 8 août 2002StatutMembreDernière intervention 4 mars 2013
-
1 mars 2004 à 17:00
Claiyah
Messages postés580Date d'inscriptionmercredi 20 août 2008StatutMembreDernière intervention20 avril 2010
-
20 avril 2010 à 17:39
Cette discussion concerne un article du site. Pour la consulter dans son contexte d'origine, cliquez sur le lien ci-dessous.
Renfield
Messages postés17287Date d'inscriptionmercredi 2 janvier 2002StatutModérateurDernière intervention27 septembre 202174 16 déc. 2009 à 14:56
Version exploitant ITextRange:
Private Sub RichTextBox1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim oRichEdit As IRichEditOle
Dim oTextDocument As ITextDocument
Dim tPt As POINT
tPt.x = ScaleX(x, ScaleMode, vbPixels)
tPt.y = ScaleY(y, ScaleMode, vbPixels)
ClientToScreen RichTextBox1.hwnd, tPt
SendMessage RichTextBox1.hwnd, EM_GETOLEINTERFACE, 0, oRichEdit
Set oTextDocument = oRichEdit
With oTextDocument.RangeFromPoint(tPt.x, tPt.y)
.Expand rtfWholeWord
CcLblOveredWord.Caption = .Text
End With
End Sub
cs_DARKSIDIOUS
Messages postés15814Date d'inscriptionjeudi 8 août 2002StatutMembreDernière intervention 4 mars 2013130 1 mars 2004 à 17:00
Vraiment excellent ! Marche à merveille ! Juste dommage que ca scintille un peu, ce qui est dû aux nombreux événement souris, mais sinon, c'est parfait !
20 avril 2010 à 17:39
20 avril 2010 à 17:24
Les sources n'ont d'intérêt qu'au travers de leurs améliorations.
Merci
20 avril 2010 à 16:19
je me suis inspirer de ta source pour faire cet exemple: http://www.vbfrance.com/codes/DETECTER-MOT-SOUS-SOURIS_51649.aspx
16 déc. 2009 à 14:56
Private Sub RichTextBox1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim oRichEdit As IRichEditOle
Dim oTextDocument As ITextDocument
Dim tPt As POINT
tPt.x = ScaleX(x, ScaleMode, vbPixels)
tPt.y = ScaleY(y, ScaleMode, vbPixels)
ClientToScreen RichTextBox1.hwnd, tPt
SendMessage RichTextBox1.hwnd, EM_GETOLEINTERFACE, 0, oRichEdit
Set oTextDocument = oRichEdit
With oTextDocument.RangeFromPoint(tPt.x, tPt.y)
.Expand rtfWholeWord
CcLblOveredWord.Caption = .Text
End With
End Sub
1 mars 2004 à 17:00
9/10
DarK Sidious