I need to loop through each character of the selected text in a rich text box applying a font aspect (family, size, or style) to each character. This aspect is selected using a font dialogue box. I do not want to introduce any other types of dialog box (e.g. color dialogue) into this code.
So far I have tentatively got the following which may well be wrong:
If aFontDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
If rtb.SelectionFont IsNot Nothing Then
rtb.SelectionFont = aFontDialog.Font
rtb.SelectionColor = aFontDialog.Color
Else
For index As Integer = 0 To rtb.SelectionLength - 1
'<<????
Next
End If
End If
EDIT
This article on CodeProject explains the problem better than I can www.codeproject.com...