CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2000
    Posts
    71

    Popupmenu in textboxes

    Hello everybody,

    I need your help. When clicking with the right mousebutton on a textbox creates a popupmenu with items like Cut, Copy, Paste an so on. Is there anything I can do to disable this popupmenu. I thin I have to set an exteded style for the textbox with the API function SetWindowLong, but I don't know how this function has to be called to do the right thing. I hope somebody could help me with this.

    Best regards

    Michael Hartmann


  2. #2
    Join Date
    Feb 2000
    Location
    Ireland
    Posts
    808

    Re: Popupmenu in textboxes

    The proper way would be to subclass it.
    I'm not sure of how to remove the menu completely but have a look at Randy Birch's site http://www.mvps.org/vbnet
    This may give you some tips.
    If all you want to do is use your own popup menu that do the following.

    private Sub Text1_MouseDown(Button as Integer, Shift as Integer, X as Single, Y as Single)
    Text1.Enabled = false
    PopupMenu Mymenu
    Text1.Enabled = true
    End Sub



    This will replace the default menu with your own popup menu.
    Hope this helps.



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