c# - setting textBox.MinWidth to largest required space for current culture, font, etc -
I want to increase my wpf text box to a minimum width so that it can complete 1 character font family, font size , And other WPF text (box) properties and current culture (can be any) Can I just set MinSwidth property to FontSize property to achieve it? Maybe it is very easy to work.
You can use.
An example:
textbox text box = new text box (); Size size = text renderer Measuretext ("A", textbox.fonts); Textbox.Width = size.Width;
Comments
Post a Comment