Jump to content
Vincent Parrett

Determining text width

Recommended Posts

Anyone know of a better way to determine the width as it would be displayed. Canvas.TextWidth is consistently giving back too a value that is around 15-20% too small. I'm using this in a custom control and have assigned the control's font to the canvas.. all to no avail. 


I have spent at least an hour searching for answers to this but got nowhere. I feel like I must be missing something obvious? 


Share this post

Link to post

Solved - the font style was being changed elsewhere which was causing TextWidth to return the value for a different font style! 🤦‍♂️

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