I’m trying to figure out if this is even possible. When someone clicks (or actually, double clicks) in my multi-line text box, I’d love to be able to figure out which of the lines[] items they double clicked on. I know I have the lines[] array as one of the properties of my windows forms textbox, and that’s kind of cool, but when they double click is there anything that will tell me which index of that was under their mouse at the time?
Share
Use the GetCharIndexFromPosition() method to find the character that was clicked. Then GetLineFromCharIndex() to get the line that contains that characters. Like this: