[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.drawing

using measureString with TextBox

shimritby

10/13/2004 12:47:00 PM

Hi,
I'm having problems with the measureString function. I am trying to
measure the length of a string the user types into a text box.
However, the size in pixels that this function returns is different
than what is displayed on screen. This causes a visual overflow from
the text box rectangle for some inputs.

I've tried using measureCharacterRanges instead and the same problem
still arises. A partial solution is supplied by using the function
getTextExtentPoint32. Using getTextExtentPoint32 there are no input
overflows, but some inputs are truncated before the end of the text
box.

Do you know of any other function that will supply a full solution?

Thanks,
Shimrit