I want to make my textbox height increases as the user inputs more text or presses Enter
The problem is you cannot find out when the user has reached the end of the textbox to increase it’s height, you cannot count characters because each character has it’s own with
also the Enter key to make a new line has it’s own problems, it only goes to the beginning of the current line if you used
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key.Equals(Key.Enter))
textBox1.Text += System.Environment.NewLine;
}
any idea how to do this ?
You must specify Auto height to Textbox. If you want that Textbox has some height in default state, you can set minimum height to it. If user input more text than it minimum height – Textbox automatically increases his height