VB Code:
Option Explicit
Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then
Text1.Enabled = False
Text1.Enabled = True
Text1.SetFocus
PopupMenu mnuTextRightClick
End If
End Sub
VB Code:
Option Explicit
Private Sub Form_Load()
Text1.Text = "Hey what's up"
End Sub
Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim word, replaced As String
If Button = vbRightButton Then
If Text1.SelLength > 0 Then
word = Text1.SelText
replaced = InputBox("What world would you like to replace """ _
& word & _
""" it with?" _
, " Replace", "dude ")
If replaced = "" Then
Exit Sub
Else
Text1.Text = Replace(Text1.Text, word, replaced)
End If
Else
Text1.Enabled = False
Text1.Enabled = True
Text1.SetFocus
PopupMenu MnuElse 'must place a menu or the regular
'menu will comeup insted which is
'what you don't want to happen
End If
End If
End Sub