IF I wanted to change the text inside of a RichTextBox on the click of a button. What code do I need?
So far I have:

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

RichTextBox1.Text(???? What goes here? because I'm getting Property access must assign to the property or use its value)

End Sub

End Class

4 Years
Discussion Span
Last Post by dalebryant76

That depends on what, specifically you want to do. If you want to implement a search-and-replace feature where the user enters the text to search for and the replacement text then you do it one way. If you want to allow the user to select a block of text and replace it with some other text then you do it another way. Please give us some more details.


I just want to replace the text inside the text box with different text when the button gets clicked.

Edited by dalebryant76


Thanks. I appreciate it! If I wanted to enter a line feed what would I need to do
EDIT -- Nevermind I figured that one out -- What if I wanted to load a RTF file and display in the RichTextBox.

Edited by dalebryant76: different question

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.