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

Recommended Answers

All 6 Replies

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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.