For Programmers: Free Programming Magazines  


Home > Archive > C# > March 2004 > MeasureCharacterRange









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author MeasureCharacterRange
Andy Meyer

2004-03-28, 10:28 pm

Hi all,

I have a UserControl which behaves like a TextBox. Whith
MeasureCharacterRanges I can get the region of every character, but I
didn't find a way to get the index in the string from a pixelpoint:

example:

String: ABCDEF
calculated with MeasureCharacterRanges: E has the x-Position: 107

but what can I do if I have the 107 and want to get the Index of E?

The only way I see is to get the rectangle of each character and
compare it with 107.

I hope I miss something and someone else knows a better solution.

Thanks in advance
Andy
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com