Jump to content
bazzer747

StringGrid Align Vertically

Recommended Posts

Hi

I have a stringgrid which has a height of about twice the height of the text that is entered in it (the right side in the attached).  I think the display would look much better if I could align this text vertically in the centre, rather than at the top of the cell.VerticallyAlign.thumb.jpg.4b26d1ce79c1ac91729c96edf843483e.jpg

 

I've tried to figure out if there is a setting somewhere but can't find one (if one exists).

 

Any help would be appreciated.

Share this post


Link to post

You can use the OnDrawCell event to draw the cell content yourself any way you like. The stringgrid.Canvas has a TextRect method that supports aligning the text in the way you want.

Edited by PeterBelow
  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×