Problem: I do not get a text box setting that will have a horizontal wordwrap function and vertically automatically increase functionality. I want to do this by writing code. I wrote the following code that creates a dblclick mouse text field with wordwrap:
TextBox text2 = new TextBox(); text2.Width = 500; text2.Visibility = Visibility.Visible; text2.Focus(); text2.Height = 30; text2.HorizontalAlignment = HorizontalAlignment.Left; text2.VerticalAlignment = VerticalAlignment.Top; Point p = e.GetPosition(LayoutRoot); text2.Margin = new Thickness(pX, pY, 0, 0); LayoutRoot.Children.Add(text2);
But the text box does not grow vertically. Can someone suggest me a C # code to do exactly what I want?
user217026
source share