如何自动缩放文本框x轴? WPF [英] How to auto scale a textbox x axis? WPF
本文介绍了如何自动缩放文本框x轴? WPF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个带有自定义字体的TextBox(Matrix Book Regular),文本框最大宽度为285,如果文本宽度大于宽度,我希望文本自动缩放x轴 (不调整大小只是为了自动缩放X轴而不改变文本框的宽度) 怎么做?
I have a TextBox with a custom font (Matrix Book Regular), and the textbox max width is 285, I want the Text to auto scale x axis if the text width is larger then its width (Not to resize just to auto scale the X axis without changing the width of the text box) How to do that ?
推荐答案
欢迎来到WPF!您可以使用类System.Windows.Controls.Viewbox
以图形方式缩放任何内容:
http://msdn.microsoft.com/en-us/library/system.windows.controls.viewbox.aspx [ ^ ]。
-SA
Welcome to WPF! You can graphically scale absolutely anything with the classSystem.Windows.Controls.Viewbox
:
http://msdn.microsoft.com/en-us/library/system.windows.controls.viewbox.aspx[^].
—SA
这篇关于如何自动缩放文本框x轴? WPF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文