hello
here is the problem
i have a textbox and i want to use key_press event for it only when i press "Enter" key..
but i want to use text_changed event also. problem is that text_changed fire itself before key_press
i mean it takes "Enter " as a text_changed not as a key_press.
how can i resolve this problem
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Enter)
{
e.KeyChar = (char)Keys.Tab;
SendKeys.Send(e.KeyChar.ToString());
}
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
AutoCompleteStringCollection srsa = new AutoCompleteStringCollection();
foreach (DataRow drsa in ob.dsss2("select accountn from partymaster", "dss").Tables[0].Rows)
{
srsa.Add(drsa[0].ToString());
}
textBox1.AutoCompleteCustomSource = srsa;
}
i want to move the cursor to next control when hit "Enter" but its not moving while if i dont use text_changed then it works fine.