I want to add a char to focused texbox in winform c#
. how can i do that ? actually i want control e.KeyChar
in myform_KeyPress
event.
private void add_user_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == '\r' && hidden_scan_textbox.Text != "")
{
shomare_shenasai_view.Text = hidden_scan_textbox.Text;
hidden_scan_textbox.Text = "";
}
if (e.KeyChar != '\r')
{
hidden_scan_textbox.Text += e.KeyChar;
//here i want to add e.KeyChar to focused texbox
e.KeyChar = '\0';
}
}