Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: popup menu for textbox


Message #1 by Ramesh Sridharan <mr_sriramesh@y...> on Thu, 6 Mar 2003 08:23:05 -0800 (PST)
A simple solution is to display your own menu, look at the
article Q191670 "HOWTO: Suppress Default Pop-up Menu When You
Use Custom Menu"
I remember now that I used it once (this is why your question was
ringing me a bell). In the web I found another way:

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
        Me.PopupMenu myCustomMenu
    End If
End Sub

the sequence Enabled False/True just does the trick to disable the
default menu (try both this way and the one in the article, I 
prefer the former because it is clearer)
You can add in your menu the capabilities of the default one.

Marco


  Return to Index