Click to See Complete Forum and Search --> : problem with measureString in textBox


shimritb
October 13th, 2004, 10:00 AM
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 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