|
-
Jan 16th, 2005, 09:11 PM
#1
Thread Starter
Junior Member
Richtextbox/string manipulation problem
I have this programming problem from Sams book learn vb 2003 in 21 days
Add some text like "A noisy noise annoys an oyster, does it not? to a rich text box: then use a While loop to convert all instances of no in that text to italic.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
While (RichTextBox1.Find("No") <> -1)
RichTextBox1.Find("No", 0, RichTextBoxFinds.None)
Dim fntItalic As New Font(RichTextBox1.Font, FontStyle.Italic)
RichTextBox1.SelectionFont = fntItalic
End While
End Sub
I understand that because the While(RichTextBox1.Find("No") <> -1) will always be true because it finds "No" everytime it loops, somehow I have to eliminate those "No" that are already italized until the statement becomes, false. If anyone can help me, i'd appreciate it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|