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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:40:57+00:00 2026-05-12T18:40:57+00:00

All, I am attempting to find a control by name within a TabControl. However

  • 0

All,

I am attempting to find a control by name within a TabControl. However my current method does not drop down to the children of the control. What is the best way to do this

Control control = m_TabControlBasicItems.Controls[controlName];

control is alway null because it is two (or three) levels below. TabPage, GroupBox, and sometimes Panel in the case of radioButtons

Thank You!

  • 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-12T18:40:57+00:00Added an answer on May 12, 2026 at 6:40 pm

    You need to recurse through all of the controls to find the right one.

    Here is a perfect example for you. You should be able to copy and paste and call it w/o mods.

    Pasting the code snippet in case the link dies:

    /// <summary>
    /// Finds a Control recursively. Note finds the first match and exists
    /// </summary>
    /// <param name="container">The container to search for the control passed. Remember
    /// all controls (Panel, GroupBox, Form, etc are all containsers for controls
    /// </param>
    /// <param name="name">Name of the control to look for</param>
    public Control FindControlRecursive(Control container, string name)
    {
        if (container == name) return container;
    
        foreach (Control ctrl in container.Controls)
        {
            Control foundCtrl = FindControlRecursive(ctrl, name);
    
            if (foundCtrl != null) return foundCtrl;
        }
    
        return null;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to select all a hrefs that do not have the class
I am attempting to find all entries in the 'archive' table that have the
I am displaying images on my page and then attempting to find the current
Bah! I have recently installed the MiniProfiler from http://code.google.com/p/mvc-mini-profiler/ attempting to find all the
I'm attempting to rewrite all all urls that are 4 exactly characters but allow
I am attempting to extract all instances of a particular format from a string:
I was attempting to store all the JMS object of the class Message recieved
I'm attempting to create a single Controller class to handle all foreseeable surveys that
I'm having all manner of trouble attempting to compile Adobe Source Libraries (ASL) on
I'm attempting to use the #define directive to change all of ulong to unsigned

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.