Setting TextBox.Width = "*" via code

Does anyone know how to set the TextBox.Width property to fill the rest of the parent container in the code? In Xaml, I would just set the Width property to *, but I cannot figure out how to do this in code.

Thanks Roy

+3
source share
2 answers

Try to execute

textBox.Width = Double.NaN;

Double.NaN (not a number) is the equivalent of any size.

+4
source

Source: https://habr.com/ru/post/1708775/


All Articles