0
 private void Cottage_Click(object sender, EventArgs e)
        {
            richTextBox1.Text = "create cottage";
            richTextBox1.Text = "create Bob";
        }

So when I run the code what gets printed is Bob of course I knew this would happen from the moment I wrote the code but I do not know what to put instead, I want to be able to print both on two seperate lines also I will have many other buttons printing into this same RichTextBox so I need to know how to move from my curent line and print on the next line everytime I click on the button....Thank you :)

Also How would I make a If statement where if the button is clicked then it prints "Hola" into the richtextbox?

Edited by Pilot122x

3
Contributors
3
Replies
14
Views
2 Years
Discussion Span
Last Post by Pilot122x
0

Try adding \n to your string. If that doesn't work try \r\n.

Also How would I make a If statement where if the button is clicked then it prints "Hola" into the richtextbox?

First step would be to create an event handler for the button click event. Then put the if statement in there.

Edited by tinstaafl

0

Yes, I find that the AppendText method does work perfectly and "tinstaafl" thanks, found out what I was trying to do wouldve given me crazy syntax errors without the Event

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.