Skip to content
Loading
  • Amit Choudhary
    0
    hi friend,

    you can use javascript for this..

    see below code

    Bash
     type="text" id="inputText1">
     type="text" id="inputText2"

    type="text/javascript">
       
    var myInput = document.getElementById("inputText1");
       
    if(myInput.addEventListener ) {
            myInput
    .addEventListener('keydown',this.keyHandler,false);
       
    } else if(el.attachEvent ) {
            myInput
    .attachEvent('onkeydown',this.keyHandler); /* damn IE hack */
       
    }

       
    function keyHandler(e) {
           
    var TABKEY = 9;
           
    if(e.keyCode == TABKEY) {
                inputText
    2.value = inputText2.value;
               
    if(e.preventDefault) {
                    e
    .preventDefault();
               
    }
               
    return false;
           
    }
       
    }



    Please marks as answer if it helps.
    0
  • Lalit M
    0
    use this code also




    0
  • 0
    hello tausif,here is a simple code for you
    key.jpg
    CODE 

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

    namespace tabctrl
    {
    public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    this.KeyUp+=new KeyEventHandler(thiskey);
    this.KeyPreview = true;
    }

    private void Form1_Load(object sender, EventArgs e)
    {
    }
    private void thiskey(object sender,KeyEventArgs e)
    {
    if (e.KeyCode==Keys.Tab)
    {
    textBox2.Text = textBox1.Text;
    }
    }
    }
    }
    MARK THE ANSWER IF IT HELPS YOU



    0