Share via


How to make text appear at the bottom of a textbox

Question

Saturday, June 1, 2013 2:38 AM

I'm making a test combat engine for text based rpg. I want to port a game that I already made form console based to using windows forms and pressing buttons. I have a multiline text box taking up most of the window, and I want it to act as an information system for the player. I want to text to appear at the bottom of the text box instead of the top. Is there any way this can be done?

All replies (3)

Saturday, June 1, 2013 2:52 AM ✅Answered

I don't know if it is possible for vertical text alignment in text box

You can see if this helps:

Textbox Text Vertical alignment

Mark as answer if this solves your problem. ... Best Regards D. Chatterjee MCA, RERF


Saturday, June 1, 2013 5:20 AM ✅Answered

Hey Valondon,

Text content can be aligned using VerticalContentAlignment to "Bottom, follow my code as follows.

 <TextBox AcceptsReturn="True" Height="200" Grid.Row="0" Text="Syed Amjad" VerticalContentAlignment="Bottom" HorizontalContentAlignment="Left"></TextBox>

Thanks & Regards
Syed Amjad Sr. Silverlight/WPF Developer,
yahoo : [email protected], skype : syedamjad.0786.
Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.


Saturday, June 1, 2013 9:02 PM ✅Answered

As Syed already showed, WPF would give your the freedom to achieve your goal simply by setting the appropriate property in 'VerticalContentAlignment', but since you're working with Windows Forms, you'll unfortunately miss this choice.

If you really want or have to stick with Windows Forms, there might exist a workaround for this limitation. Take a look at this post on Stackoverflow: http://stackoverflow.com/questions/2653153/c-sharp-winforms-vertical-alignment-for-textbox-etc

Simply put, you have to create a custom textbox comprising a textbox within a textbox and this former textbox is borderless and docked at the bottom of the latter one, so that the whole thing just looks like one textbox with the text aligned at the bottom.

Kind regards,

wizend