Hi, i want to ask u something guys. i have one textbox. While writing in, after pressing Space, i want to intstead of white space, write this "|" . This is my code
void TextBox1KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Space)
{
textBox1.AppendText("|");
}
}
Problem is it dont write only "|" but "| " . After that char it put whitespace and cursor moves after that white space. I try to use method
textBox1.Text = textBox1.Text.Substring(0, (textBox1.TextLength - 1));
but it dont work because it delete my "|" no that whitespace, since whitespace is not char....
Thanks for any help