Monday, 6 May 2013

HOW TO STOP COPY PASTING

HI GUYS !

Welcome Back !!!!

Now we are creating a very simple but very use full application through ADO.NET. As we see our heading is "how to stop copy pasting" .For this application we are using c# language which is .net saturated language.
very simply i am using  a form from visual studio and take text box.

like this image :

Now, we are using a event like mouse-down and key-down event.

c# code :


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication4
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void textBox1_MouseDown(object sender, MouseEventArgs e)
        {
            textBox1.SelectionLength = 0;
        }

        private void textBox1_KeyDown(object sender, KeyEventArgs e)
        {
            textBox1.SelectionLength = 0;
        }
    }
}


and the ouput come like this image :




Any word we are write here but nothing will be copy past from here!!!
Thank you friends..... 

0 comments:

Post a Comment