Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7887317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:32:55+00:00 2026-06-03T05:32:55+00:00

I want to display something multiple times in a textbox. For example if you

  • 0

I want to display something multiple times in a textbox. For example if you use this code and replace richtextbox with messagebox, it will keep displaying the text until the loop ends. I want to display the text from textBox1 into richTextBox1, and then have the program hit enter, and then type it out again in the richtextbox. It’s kind of confusing sorry, but if you have any questions just comment them and i’ll be more clear. This is my code:

private void button1_Click(object sender, EventArgs e)
    {
        Clipboard.SetText(textBox1.Text);

        int text = 0;
        int end = int.Parse(textBox2.Text);
        while (text<=end)
        {
            richTextBox1.Text=(Clipboard.GetText());
            text++;
        }

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T05:32:56+00:00Added an answer on June 3, 2026 at 5:32 am

    In your code you have:

    richTextBox1.Text=(Clipboard.GetText());
    

    The reason that your code is not working is because in every loop, you are setting the text to whatever is on the clipboard, so at the end of the loop it will only have it in there once. You need to ‘append’ or add onto the end of the text so it will have it multiple times:

    richTextBox1.Text += richTextBox1.Text + (Clipboard.GetText());
    

    Or:

    richTextBox1.Text += (Clipboard.GetText());
    

    This will add the clipboard text onto the end of the RichTextBox, so you will have the same text multiple times, but all on the same line. If you want to make the text appear on multiple lines, you have to add a new line after appending the text:

    richTextBox1.Text += (Clipboard.GetText())+"\r\n";
    

    Or:

    richTextBox1.Text += (Clipboard.GetText())+Enviroment.NewLine;
    

    Hope this Helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to do something like this: [Display(Name = Plain text. <span class=\red strong\>Red
I want to use multiple loops on the homepage. First i want to display
I am learning OOP with python. I want to implement something like to display:
I want display data from database in Listbox...Here is my code, It is not
I have db with this table (TableToDo): http://goo.gl/NlTEk I want display all records in
In the header of the django admin, I want display a link. This link
So I want to display results from multiple queries from the same controller. I
i am creating a page that will display multiple images from the database... i
I want to do something like this.. I have a update form in PHP,
I want to display on my website something similar to google maps transit directions,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.