I'm trying to retrieve font names for each line of text in a RichTextBox (each line is having a different font). Below is the code that I'm using to get the font name of second line in the RTB.
RichTextBox2.Select(RichTextBox2.Lines(0).Length + 1,
RichTextBox2.Lines(1).Length)
font = RichTextBox2.SelectionFont.Name
But I'm getting the font name of the first line of textbox. Any help is appreciated.
Try using the GetFirstCharIndexFromLine function to get the beginning point of each line:
This is what I used to setup the RichTextBox control: