L’esempio riportato di seguito mostra come contare le linee di un RichTextbox utilizzando Vb.Net :

private sub countlines(byval rtb as richtextbox)
          dim count as string
          count = rtb.lines.count
          msgbox(count)
end sub

last VB.NET : Come contare le linee di un richtextbox