Try something like this:
Dim sLine As String
Dim iCont As Integer
For (i As Integer = 0 To rt.Lines.Lenght - 1)
sLine = rt.Lines(i)
rt.Select(iCont, sLine.Length - 1)
If rt.SelectionFont.Bold Then
richtextboxOutput.AppendText("Line "& i + 1 &" is Bold")
Else
richtextboxOutput.AppendText("Line "& i + 1 &" is Not Bold")
End If
iCont += sLine.Length
Loop
Where rt
is the RichTextBox
. This will check if the whole line is bold.
You can't test if something is bold passing only a string to the function, as the only option then is to find the text into the RichTextBox and could be repeated. If you want to do a function you could do something like this:
Function IsBoldText(rt As RichTextBox, start As Integer, length As Integer)
rt.Select(start, length)
Return rt.SelectionFont.Bold
End Function