Right Clicking in a Text Box 
Author Message
 Right Clicking in a Text Box

Is there anyway to NOT show the default popup menu, when you right click
in a textbox control?  When I right click in the text box I get the
default "Undo, Cut, Copy, Paste.." menu, when I move off of it, and
click either ther right or left mouse button, then my popup menu
appears.  I would like my popup menu to display first, and not display
that damn default menu at all!  

Can anyone please help me?

--
Best Regards,

  Bruce Nichols



Tue, 12 Sep 2000 03:00:00 GMT  
 Right Clicking in a Text Box

Hi,

This was just posted a couple of days ago by someone else :0)

In MouseDown:

  Text1.Enabled = false
  text1.enabled = true
  popupmenu yourpopup

Hope this helps!

Shawn

Quote:

> Is there anyway to NOT show the default popup menu, when you right click
> in a textbox control?  When I right click in the text box I get the
> default "Undo, Cut, Copy, Paste.." menu, when I move off of it, and
> click either ther right or left mouse button, then my popup menu
> appears.  I would like my popup menu to display first, and not display
> that damn default menu at all!

> Can anyone please help me?

> --
> Best Regards,

>   Bruce Nichols



Tue, 12 Sep 2000 03:00:00 GMT  
 Right Clicking in a Text Box

Bruce-
    This works for me. The commonly recommended
way is to quickly disable/enable the Textbox.
Joe

__________________snip____________________________________-
Option Explicit
Private Declare Function SendMessage Lib "user32" _
   Alias "SendMessageA" (ByVal hwnd As Long, _
   ByVal wMsg As Long, ByVal wParam As Long, _
   lParam As Any) As Long
'-------------------------------------------------
Private Const WM_RBUTTONDOWN = &H204

Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
   Dim lRetVal As Long
   If Button = vbRightButton Then
      lRetVal = SendMessage(Me.hwnd, WM_RBUTTONDOWN, 0, 0)
      Call PopupMenu(mnuPopUp)
   End If
End Sub
___________snip_______________________________________________

--
*******************************************************************

Microsoft Developer MVP Visual Basic
Try Yankee Clipper Plus( April 1998 PCWorld "Best
Free Stuff Online" )
http://www.tiac.net/users/lvasseur/ycphome.html
*******************************************************************

Quote:

>Is there anyway to NOT show the default popup menu, when you right click
>in a textbox control?  When I right click in the text box I get the
>default "Undo, Cut, Copy, Paste.." menu, when I move off of it, and
>click either ther right or left mouse button, then my popup menu
>appears.  I would like my popup menu to display first, and not display
>that damn default menu at all!

>Can anyone please help me?

>--
>Best Regards,

>  Bruce Nichols



Tue, 12 Sep 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Right Click Question - Rich Text Box

2. Right click in rich text box

3. Disable default Win95 right click menu in text boxes?

4. Rich Text Box and Right Click

5. Disabling a text boxes right click menu (VB6)

6. Text box right click

7. Text box right mouse click??

8. Help: Right Mouse Click on Standard Text Box!!!

9. Help: Right Mouse Click on Standard Text Box!!!

10. Text box right click edit menu

11. Right Click On Text Box

12. Help: Right Mouse Click on Standard Text Box!!!

 

 
Powered by phpBB® Forum Software