本文介绍了如何在WPF中的内部TextBoxView上设置边距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在某些情况下,我想最小化文本框的水平填充.

I have a case where I want to minimize the horizontal padding of a textbox.

使用snoop,我发现文本框包含多个子控件.其中之一是TextBoxView,其边距为2,0,2,0

Using snoop I found that the textbox consists of a multiple sub-controls.One of them is a TextBoxView with a margin of 2,0,2,0

TextBoxView是一个内部wpf组件,没有公共API.

The TextBoxView is an internal wpf component and has no public API.

您将如何摆脱内部填充"?

How would you approach getting rid of the "internal padding"??

推荐答案

将外部边距设置为-2,0,-2,0以补偿填充.

Set the outer margin to -2,0,-2,0 to compensate for the padding.

这篇关于如何在WPF中的内部TextBoxView上设置边距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 22:41