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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:57:49+00:00 2026-05-23T11:57:49+00:00

I have added controls dynamically on runtime inside the rows of a tableLayoutpanel ,

  • 0

I have added controls dynamically on runtime inside the rows of a tableLayoutpanel , the controls added are LABELS, LINKLABEL AND A PICTURE BOX.

Now , i want to change the value(Text Property) of these dynamically added controls(Labels, Linklabels) to some specified value, on a button click.

How do i do this? Please help with code.

Is there some kind of ID for these dynamically controls like we have in HTML.

Also , am trying to use this but all in vain………..

Control[] GettableLayoutPanelControls = new Control[11];

          GettableLayoutPanelControls =  tableLayoutPanel1.Controls.Find("Control Name", true) ;

             GettableLayoutPanelControls.SetValue("CHANGED VALUE ", 0); //this line gives error..........
  • 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-05-23T11:57:50+00:00Added an answer on May 23, 2026 at 11:57 am

    Try something like this, which will add 11 new text boxes (or any other control you want):

    int NumberOfTextBoxes = 11;
    TextBox[] DynamicTextBoxes = new TextBox[NumberOfTextBoxes];
    int ndx = 0;
    
    while (ndx < NumberOfTextBoxes) 
    {
        DynamicTextBoxes[ndx] = new TextBox();
        DynamicTextBoxes[ndx].Name = "TextBox" + ndx.ToString();
        // You can set TextBox value here:
        // DynamicTextBoxes[ndx].Text = "My Value";
        tableLayoutPanel1.Controls.Add(DynamicTextBoxes[ndx]);
        ndx++;
    }
    

    This will dynamically add Text Boxes to your TableLayout control. If you need to retreive them later:

    foreach (Control c in TableLayoutPanel1.Controls)
    {
        if (c is TextBox)
        {
            TextBox TextBoxControl = (TextBox)c;
    
            // This will modify the value of the 3rd text box we added
            if (TextBoxControl.Name.Equals("TextBox3"))      
                TextBoxControl.Text = "My Value";
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form where controls are dynamically added to a Panel. However, when
I have a page that has 3 used controls that are dynamically added to
I am working on a winforms app and I have added some controls dynamically
I have an ATL control that I want to be Unicode-aware. I added a
I have a UserControl ('AddressInfoGroup') within an updatepanel that dynamically loads user controls ('AddressInfo')
I'm using a winForm. I have 2 custom controls that I want to add
I have a dynamically created button that is being added to an update panel
I have written a control in C# that derives from System.Windows.Forms.Control. I have added
I have added some code which compiles cleanly and have just received this Windows
I have added the required assemblies and registered the NVelocityViewFactory in global.asax.cs page but

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.