Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a Textbox in a silverlight app like this:
XML
<TextBox AcceptsReturn="True" TextWrapping="Wrap" Height="200" HorizontalContentAlignment="Left" VerticalContentAlignment="Top" VerticalAlignment="Top" HorizontalAlignment="Stretch"></TextBox>


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
Posted

1 solution

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.
XML
<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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900