code_junkie

Windows forms: how get the actual width of the item in the list box

Nov 13th, 2011
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.12 KB | None | 0 0
  1. Graphics g = control.CreateGraphics();
  2. int width = (int)g.MeasureString(aString, control.Font).Width;
  3. g.dispose();
Add Comment
Please, Sign In to add comment