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

Popular posts from this blog

php - Creating canonical URLs with custom route-classes -

mysql - Formatting problem with PHP DateTime Difference when used as part of an equation -

Mysql Local server hardware -