如何删除 TextBlock 周围的额外空间 [英] How to Remove Extra Space Around TextBlock

查看:26
本文介绍了如何删除 TextBlock 周围的额外空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我的 TextBlock 设置了以下内容

I have the following set up for my TextBlock

<TextBox x:Name="SearchTextBlock" InputScope="Search" Opacity="0.999" 
             Height="Auto" VerticalAlignment="Top"
                 BorderBrush="{StaticResource ThemeBrush}" BorderThickness="8" />

产生的结果

但是在 TextBlock 周围保留了额外的空间.我该如何删除它?我需要创建样式还是可以在 TextBlock 标签本身内完成?

But extra space remains around the TextBlock. How might I remove this? Do I need to create a style or can this be done within the TextBlock tag itself?

推荐答案

从设计器中右键单击 TextBox 并选择 Edit Template -> Edit a复制

From the Designer right click on the TextBox and select Edit Template -> Edit a Copy

选择你想保存的位置并选择它的Key

Choose where do you want to save it and choose it's Key

然后分析生成的代码你会看到 Margin="{StaticResource PhoneTouchTargetOverhang}"女巫,你可以玩,直到你喜欢的结果.

And then analyzing the code generated you see Margin="{StaticResource PhoneTouchTargetOverhang}" witch you can play with until you like the result.

这篇关于如何删除 TextBlock 周围的额外空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆