i have 2 textbox,txtbox1 and txtbox2.I want that,when i am entering value in textbox1 as i have to write CODE,then first i will press C in textbox1,but as i type C,in textbox1 then should also display in txtbox2.and so on till CODE.
ActuallY i m using user control UI,inside i draw a texbox,then using on my forms.I m giving u detail explanation-
1-I add an item User Control
2-Add a textbox into User Control
3-On my main windows form i take 2 times my usercontrol whose name UCTxtBox
so i want as i m entering text into UCTxtBox1.Textbox1.text,so on every key i m pressing it should show continiously in UCTxtBox2.Textbox2.text.
Suppose i have to write -CODE
1-first i will press C in UCTxtBox1.Textbox1.Text,then it should also come in UCTxtBox2.Textbox1.Text
2-i will press O this time in UCTxtBox1.Textbox1.Text then the text of UCTxtBox1.Textbox1.Text will be-CO,THEN CO SHOULD DISPLAY IN UCTxtBox2.Textbox1.Text
AND SO ON
here UCTxtBox is UserControlUI Component
----------------------------------------------------------------------------------------------
1-Form1.cs 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 TxtBoxAutomation
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void ucTxtBox1_KeyPress(object sender, KeyPressEventArgs e)
{
ucTxtBox1.textBox1.Text = ucTxtBox2.textBox1.Text;
}
}
}
2-UCTxtBox.cs code-
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace TxtBoxAutomation
{
public partial class UCTxtBox : UserControl
{
public UCTxtBox()
{
InitializeComponent();
}
}
}