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 1106489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:48:05+00:00 2026-05-17T01:48:05+00:00

I have a RichTextBox created programmatically with the following code: RichTextBox RT = new

  • 0

I have a RichTextBox created programmatically with the following code:

RichTextBox RT = new RichTextBox();
RT.Name = "asdf";
RT.Text = "blah";

TableLayoutPanel.Controls.Add(RT,0,0);

Now let’s say I want to modify the text of RT, and it’s name is “asdf”, Visual Studio won’t allow me to write asdf.Text = “haha” because asdf doesn’t exist yet.

How can I grab “asdf” specifically and set its text? Because this RichTextBox is in a specific cell, can I grab it based on its cell coordinates?

  • 1 1 Answer
  • 1 View
  • 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-05-17T01:48:06+00:00Added an answer on May 17, 2026 at 1:48 am

    Well… you did instantiate the RichTextBox and have a reference that you can use; it’s called “RT” in your example.

    Now, likely you’ve done this in a method so it was locally scoped and is no longer available when you want it. So you save that reference somehow by assigning it to some member you can access. If you have a lot of them and want to differentiate by name somehow, you might stick it into a Dictionary<string, RichTextBox>, for example. Or you could put it in some static variable; there are numerous options, each with their own pros and cons.

    The one thing you probably don’t want to do is walk the control tree looking for the control with the name you specified. But you could also do that, if you really wanted to.

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

Sidebar

Related Questions

From here I have seen it suggested that an instance of RichTextBox be created
I have a RichTextBox and I add some texts programatically. I need to display
I have a RichTextBox that I wish to fill with RTF text at design
We have a Silverlight application using the RichTextBox as a rich text editor for
I have a RichTextBox and I want to save the text to a file.
I've created a new tabpage and also added a richtextbox to it: Private Sub
I have RichTextbox with transformation as follows: <RichTextBox Name=mainRTB AcceptsTab=True VerticalScrollBarVisibility=Auto HorizontalScrollBarVisibility=Auto TabIndex=0 DockPanel.Dock=Top>
how to filter CTRL + V in richTextBox? I have richtextbox with text blabla
I have a richtextbox that its text is a concatenation of some words from
I have a WPF RichTextBox which contain in its FlowDocument both text and images.

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.