0

i am trying to use SendKeys.Send() to send textbox1.Text to a application ( like notepad ), and i want to disable or remove spaces from the textbox so there is no spaces in the application. Any help is appreciated!

 private void InfoSend_Click(object sender, EventArgs e)
    {
        System.Threading.Thread.Sleep(3000);
        SendKeys.Send(input_info);
    }

    private void textBox1_TextChanged(object sender, EventArgs e)
    {
        input_info = textBox1.Text;

    }
Roblox
  • 47
  • 5

1 Answers1

1

If user can input white spaces to TextBox then you can write this:

private void InfoSend_Click(object sender, EventArgs e)
{
    System.Threading.Thread.Sleep(3000);
    input_info = input_info.Replace(" ", string.Empty);
    SendKeys.Send(input_info);
}
Zheglov
  • 61
  • 8