无论设置如何,Silverlight Multiline文本框都会使文本居中 [英] Silverlight Multiline textbox keeps text centered regardless of settings
本文介绍了无论设置如何,Silverlight Multiline文本框都会使文本居中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Silverlight应用程序中有一个文本框,如下所示:
Hi,
I have a Textbox in a silverlight app like this:
<TextBox AcceptsReturn="True" TextWrapping="Wrap" Height="200" HorizontalContentAlignment="Left" VerticalContentAlignment="Top" VerticalAlignment="Top" HorizontalAlignment="Stretch"></TextBox>
我的问题是,无论我设置了什么设置,输入的文本都会保持垂直居中.
我肯定错过了什么??我尝试了Google,但没有找到与我的问题有关的任何东西.任何建议,将不胜感激.
在此先感谢
My problem is that the text you enter stays vertically centered regardless of what settings I set.
I must be missing something?? I tried Google, but I''m not really finding anything relating to my problem. Any advice would be appreciated.
Thanks in advance
推荐答案
对不起,您刚刚意识到这可能是我正在使用的主题.因此,我在Google上搜索了更多,并认为我会在这里为其他人发布解决方案.最终这样做是为了覆盖默认的文本框主题.
Sorry guys, just realized that it might be the theme I''m using. So I googled a bit more and and thought I''ll post my solution here for someone else. Ended up doing this to override the default textbox theme.
<stackpanel.resources>
<style targettype="TextBox">
<setter property="VerticalContentAlignment" value="Top"></setter>
</style>
</stackpanel.resources>
唯一的问题是,现在该文本框的样式不像其他文本框,但这对于我正在做的事情是很好的.
问候
The only issue is that now the textbox isn''t styled like the others, but this is fine for what I''m doing.
Regards
这篇关于无论设置如何,Silverlight Multiline文本框都会使文本居中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文