proper char width

  • Thread starter Thread starter bj
  • Start date Start date
B

bj

hello
is there any chance to get proper char width for
class derived from user control - im working over
text editing control, so i need proper width of every
character for currently selected font, in my example i
bind parent font and i use Api function GetCharWidth
to get characters width, this function working fine for
mfc however values returning for C# control looks bigger
than actual character pixel width for that control,
the GetCharWidth description says that returning value is
logical width of character so maybe i need some sort
of converting to device width to get proper value ...

thanks for any advice
bj
 
* "bj said:
is there any chance to get proper char width for
class derived from user control - im working over
text editing control, so i need proper width of every
character for currently selected font, in my example i
bind parent font and i use Api function GetCharWidth
to get characters width, this function working fine for
mfc however values returning for C# control looks bigger
than actual character pixel width for that control,
the GetCharWidth description says that returning value is
logical width of character so maybe i need some sort
of converting to device width to get proper value ...

Did you try 'Graphics.MeasureString'?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
 
Back
Top