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

  • SEARCH
  • Home
  • 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 7865141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:59:46+00:00 2026-06-02T23:59:46+00:00

I need to retrieve the text from a textbox within a custom control. The

  • 0

I need to retrieve the text from a textbox within a custom control. The custom control is part of an ArrayList so there can be multiple custom controls displayed on a Form. How do I access the text from a single textbox within one of the controls in the ArrayList?

The code below shows how I’m creating the dynamic custom control:

    ArrayList assessmentInfo = new ArrayList();

    int length = (int)moduleInfoLevel6.numericUpDownModuleAssessmentNum.Value;
    for (int i = 0; i < length; i++)
    {
        assessmentInfo.Add(new AssessmentInfo());
        System.Drawing.Point p = new System.Drawing.Point(10, 160 + i * 32);
        (assessmentInfo[i] as AssessmentInfo).Location = p;
        (assessmentInfo[i] as AssessmentInfo).Size = new System.Drawing.Size(440, 32);                
        tabPageLevel6.Controls.Add((assessmentInfo[i] as AssessmentInfo));
    }

Here are screenshots showing how the custom control is displayed:

assessmentInfo custom control

https://i.stack.imgur.com/EjbRw.jpg

How the custom control is displayed on the form

https://i.stack.imgur.com/1hm1A.jpg

  • 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-02T23:59:47+00:00Added an answer on June 2, 2026 at 11:59 pm

    you could add a name to each control

    something like:

    (assessmentInfo[i] as AssessmentInfo).Name = "assessmentInfo" + i.ToString();
    

    then you could access it in the following way

    foreach (object control in tabPageLevel6.Controls)
    {
        if (control is AssessmentInfo)
        {
            if ((control as AssessmentInfo).Name == "assessmentInfo1")
                // do something with the control
                MessageBox.Show((control as AssessmentInfo).Name);                    
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to retrieve multiple objects from an external system. The external system supports
I want to use java to retrieve text from a website. I can easily
How can I retrieve a text field from mysql db table, but not the
How to retrieve the trimmed text (LTRIM and RTRIM) from a TextArea control. The
I can access the text within a textbox within my repeater, but I am
I need to retrieve text from a remote web site that does not provide
I need to add text to a ScrollableLayout after it's remotely retrieved from an
I need to retrieve the character position of the selected text in a RichTextBox.
I need to retrieve random rows from SQL Server database. I am looking for
I need to retrieve the date from a UIDatePicker (Preferably I would also like

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.