Strogm,
Here is the code for this problem
Private Sub RTF1_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode <> 190 Then
Picture4.Visible = False
Picture6.Visible = False
Exit Sub
End If
Dim FF As Integer
Dim PT As POINTAPI
Dim tmpEnd As Integer
Dim tmpBeg As Integer
Dim iEval As Integer
Dim tmpStr As String
Dim tmp2 As String
Dim X As Integer
Dim eChar As String
Dim codeObj As String 'LOCAL "gObjName" Temp String
Dim F As String
Dim lngStart As Integer
Dim tmpLeft As Integer
Dim tmpTop As Integer
Dim A As String
GetCaretPos PT
iEval = 600
tmpEnd = RTF1.SelStart
tmpBeg = tmpEnd - iEval
If tmpBeg < 0 Then tmpBeg = 0
RTF1.SelStart = tmpBeg
RTF1.SelLength = tmpEnd - tmpBeg
If Right$(RTF1.SelText, 1) <> "." Then
Do Until Right$(RTF1.SelText, 1) = "."
RTF1.SelLength = RTF1.SelLength + 1
Loop
End If
tmpStr$ = RTF1.SelText
RTF1.SelStart = tmpEnd
RTF1.SelLength = 0
tmp2$ = ""
For X = 1 To (Len(tmpStr$) - 1)
eChar$ = Mid$(tmpStr$, X, 1)
If eChar <> Chr$(10) And eChar <> Chr$(13) _
And eChar <> " " And eChar <> "." Then
tmp2$ = tmp2$ & eChar$
Else
tmp2$ = " "
End If
Next
tmp2$ = Trim$(tmp2)
If Right$(tmp2, 1) <> "." Then tmp2 = tmp2 & "."
codeObj = tmp2$
List1.Clear
F$ = CurDir & "\obj.txt"
gObjName = ""
FF = FreeFile
Open F$ For Input As FF
Do Until LCase$(Trim$(A$)) = LCase$(codeObj$)
If EOF(FF) Then Exit Do
Line Input #FF, A$
Loop
gObjName = codeObj$
Do Until Trim$(A$) = "!"
Line Input #FF, A$
If Trim$(A$) <> "!" And Trim$(A$) <> "" Then
List1.AddItem Right$(A$, Len(A$) - Len(codeObj))
End If
Loop
Close FF
If List1.ListCount = 0 Then Exit Sub
lngStart = RTF1.SelStart
RTF1.SelStart = RTF1.SelStart - Len(codeObj$)
RTF1.SelLength = Len(codeObj$)
If (PT.X * 15) + (RTF1.SelFontSize * 15) + _
Picture4.Width + 45 < Width Then
tmpLeft = (PT.X * 15) + (RTF1.SelFontSize * 15) + 45
Else
tmpLeft = (PT.X * 15) + (RTF1.SelFontSize * 15) - _
Picture4.Width - 45
End If
If (PT.Y * 15) + (RTF1.SelFontSize * 25) + _
Picture4.Height + 45 < Height Then
tmpTop = (PT.Y * 15) + (RTF1.SelFontSize * 25)
Else
tmpTop = (PT.Y * 15) + (RTF1.SelFontSize * 25) - _
Picture4.Height - RTF1.SelFontSize * 25
End If
Picture4.Move tmpLeft, tmpTop
Picture4.Visible = True
Picture6.Move tmpLeft + 45, tmpTop + 45, _
Picture4.Width, Picture4.Height
Picture6.Visible = True
List1.SetFocus
I hope this option can be doable.
Aaron
Fear is the mind killer!!!!!!