如何在 WPF 中缩放文本大小以及 TextBox 大小?
当我调整 WPF 应用程序的窗口大小时,所有文本框也会调整大小。问题是文本框中文本的大小没有改变。如何实现文本大小随文本框大小的缩放?
编辑:实际上,它是缩放,但我想让文本变大。因此,字体的高度应该接近文本框的高度。如何实现这一目标?
When I resize Window of the WPF application, all textboxes are also resized. The problem is that size of the text in the textboxes doesn't change. How can I achieve scaling the size of the text along with the size of the textboxes?
Edit: Actually, it is scaling, but I want to make text bigger. So, the height of the font should be close to height of the textbox. How this can be achieved?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许这样的东西会有所帮助
只需使用 TextBox 的 maring 属性即可获得您想要的东西
maybe something like this will help
Just play with the maring property of the TextBox to get what you want
我认为您可以使用此代码:\
在 TextBox 中的 SizeChange 事件中
I Think You Can Use This Code:\
In SizeChange Event In TextBox