Click here to Skip to main content
Sign Up to vote bad
good
See more: VB.NET
how can i disable copy paste in textbox in window application.Plz help me
Posted 17 Jun '12 - 23:07
sofia3695


4 solutions

You have to apply on which textbox.In Form Load event,You can use this code-
 
textBox1.ContextMenu = new ContextMenu();
  Permalink  
Comments
idle63 - 18 Jun '12 - 8:20
But still shortcuts (Ctrl&v) will work. See my solution 4.
sofia3 - 19 Jun '12 - 8:08
thanks a lott rahul and idle63:)
Simply set the textbox property "ShortcutsEnabled" to false and you got it.
This way neither popup nor Ctrl&V will be accepted as textinput.
 
Regards.
  Permalink  
Comments
sofia3 - 19 Jun '12 - 8:08
thanks a lotttt
idle63 - 19 Jun '12 - 8:24
You are welcome.
  Permalink  
Comments
sofia3 - 18 Jun '12 - 6:28
i dont want my textbox to be in read only ..i want that user can input watsoever values but he cant use copy paste ..plz help
use this code
 
private void Form1_MouseClick(object sender, MouseEventArgs e)
{
    if (e.Button.ToString().ToLower()=="right")
    {
    SendKeys.Send("{Esc}");
    }
}
  Permalink  
Comments
sofia3 - 18 Jun '12 - 6:18
its not working:(

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 611
1 Maciej Los 265
2 Slacker007 240
3 CPallini 235
4 OriginalGriff 210
0 Sergey Alexandrovich Kryukov 9,118
1 OriginalGriff 7,134
2 CPallini 3,803
3 Rohan Leuva 3,135
4 Maciej Los 2,558


Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 18 Jun 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid