Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. private int StringLen(string candidate)
  2. {
  3. var formattedText = new FormattedText(
  4. candidate,
  5. CultureInfo.CurrentUICulture,
  6. FlowDirection.LeftToRight,
  7. new Typeface(this.textBlock.FontFamily, this.textBlock.FontStyle, this.textBlock.FontWeight, this.textBlock.FontStretch),
  8. this.textBlock.FontSize,
  9. Brushes.Black);
  10.  
  11. return formattedText.Width;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement