Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. how to restrict paste option

how to restrict paste option

Scheduled Pinned Locked Moved C#
csharptutorialquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    amalatsliit
    wrote on last edited by
    #1

    hey guys i want to restrict paste option for my textbox control in windows application. how do i do this in c#

    A R S 3 Replies Last reply
    0
    • A amalatsliit

      hey guys i want to restrict paste option for my textbox control in windows application. how do i do this in c#

      A Offline
      A Offline
      AB7771
      wrote on last edited by
      #2

      Trap the Ctrl+V event on the textbox and clear the Clipboard before the paste event Regards, Pramod

      R 1 Reply Last reply
      0
      • A amalatsliit

        hey guys i want to restrict paste option for my textbox control in windows application. how do i do this in c#

        R Offline
        R Offline
        Ravi Bhavnani
        wrote on last edited by
        #3

        You may be able to implement this by (a) removing the Paste item from the textbox's context menu (accessible using the ContextMenu property) and (b) handling the KeyPress event to ignore Ctrl/V. /ravi My new year's resolution: 2048 x 1536 Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

        1 Reply Last reply
        0
        • A AB7771

          Trap the Ctrl+V event on the textbox and clear the Clipboard before the paste event Regards, Pramod

          R Offline
          R Offline
          Ravi Bhavnani
          wrote on last edited by
          #4

          Yadav Pramod wrote:

          clear the Clipboard before the paste event

          Why is this necessary? It seems overly aggressive to silently clear the contents of the clipboard. /ravi My new year's resolution: 2048 x 1536 Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

          1 Reply Last reply
          0
          • A amalatsliit

            hey guys i want to restrict paste option for my textbox control in windows application. how do i do this in c#

            S Offline
            S Offline
            S Senthil Kumar
            wrote on last edited by
            #5

            Have a look at this[^] article. It traps the paste event (overrides WndProc and handles WM_PASTE), which is what you wanted. Regards Senthil _____________________________ My Blog | My Articles | WinMacro

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups