how to make a underline in richtextbox in vb 2005
Hi all,
Can anybody can help with my problem.
i have two richtextbox that compare if the wring word is inputted..
i want just to underline the words that the user have type wrong..
my problem is the next word that is wrong or not equal i not underline but the first word is being underline.
Code:
Dim Str1 As Array
Dim str2 As Array
On Error Resume Next
Str1 = Split(Trim(richtextbox1.text), " ")
str2 = Split(Trim(richtextbox2.text), " ")
For i As Integer = 0 To Str1.Length - 1
If String.Compare(Str1(i).ToString, str2(i).ToString, False) <> 0 Then
If Str1(i).ToString <> str2(i).ToString Then
'underline the data that a wrong word
'the equal string is the error that needs to be underline
'the problem occurs on the wrong word
displayerrorstrring=str2(i).ToString
End If
errorcounter = errorcounter + 1
End If
Next
PS.. it must be done on lostfocus event.
Really appropriated your help. i'am really lost here.
Thanks.
Re: how to make a underline in richtextbox in vb 2005
You might try asking in a VB.Net forum instead of here in General Developer.