designwitt
asked on
Center Text Verically and Horizontal in a rich text box
hello all,
i am making a little flash card app to help me with some studying, im wondering how do i center the text vertically and horizontally in the text box? is there a way or do i need to use another control? i wanting the text to appear as if it was on a note card like a regular flash card, with the text in the middle.
Thanks for the help
i am making a little flash card app to help me with some studying, im wondering how do i center the text vertically and horizontally in the text box? is there a way or do i need to use another control? i wanting the text to appear as if it was on a note card like a regular flash card, with the text in the middle.
Thanks for the help
ASKER
cool, yeah that worked great, is there way to make it stay in the panel? like wordwrap or something? because when i put a long definition in there it just runs off the side.
Thanks
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
With RichTextBox1
.Text = "Hello"
.SelectAll()
.SelectionAlignment = HorizontalAlignment.Center
End With
vertical is a pain in the %$#^&&*.
You could just 'draw' the text centered on any control you want, provided that you dont need to select / copy / paste from it.
Here is a method that will draw centered to a panel control named Panel1. You could modify it to draw to any control that has a .CreateGraphics() method...
Open in new window