CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: Text Box

  1. #1
    Join Date
    Jul 1999
    Posts
    6

    Text Box

    At run time when I click right mouse button I get a default popup menu with options like cut,copy,delete. How to prevent this menu to appear


    Thanks

    krr

  2. #2
    Guest

    Re: Text Box

    What does this question have to do with TextBox?


  3. #3
    Join Date
    Jul 1999
    Posts
    34

    Re: Text Box

    I don't think there is a way to do it, because it's default windows function, when you right-click onto a textbox, it shows pop-up menu


  4. #4
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Text Box

    I remember seeing some code on Vbthunder site.
    Check it out: [link]http://www.vbthunder.com[/link]

    RK

  5. #5
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Text Box

    You can subclass the textbox and look for WM_RBUTTONDOWN and eat it way.!! Also there are a couple of samples on Codeguru.com/vb section that shows how to display other menus as well.

    Here is one such link, from there.
    http://www.mvps.org/vbnet/code/subclass/contextmenu.htm

    RK

  6. #6
    Guest

    Re: Text Box

    I made a PopUpMenu for a listbox in one of my programs. First, make a menu(in menu editor), make it hidden. In the projects, doubleclick the textbox(to edit the code), and make it MouseDown. Look at this:
    Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 2 Then
    PopupMenu menur 'menur should be replaced with whatever you named yoru menu
    End If
    End Sub
    It doesn't work for the textbox(i don't think), but try to work with this code. If you change the button to 1, then it'll work for the left mousebutton

    Che


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured