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
You are looking for
HorizontalAlignment="Stretch"
Related answers:
WPF - setting HorizontalAlignment = stretching to a text box in a StackPanel
Horizontal alignment = alignment with stretch, maximum width and left edge at the same time?
Try to execute
textBox.Width = Double.NaN;
Double.NaN (not a number) is the equivalent of any size.
Source: https://habr.com/ru/post/1708775/More articles:Могу ли я захватить предупреждение "Unrecognized escape" при компиляции регулярного выражения? - regexGoogle Maps tiles - how to divide 30 thousand coordinates into tiles - mapsJam when solving the minimum pairing problem - algorithmNeed / need to pass NSError ** as an argument to make a selection - objective-cThe problem of stretching a text field - cssSQL Server datetime datatype does not allow many formats - datetimeWindsor Castle: - Injection interface dictionary through configuration - c #How can I create one autotools project against another autotoolset project that is not installed? - build-processInstall MyLabel.Text in Repeater HeaderTemplate - asp.netImage resizing and performance - performanceAll Articles