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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:43:37+00:00 2026-05-22T01:43:37+00:00

I have a TabControl that contains several tabs. Each tab has one UserControl on

  • 0

I have a TabControl that contains several tabs. Each tab has one UserControl on it. I would like to check the visibility of a control x on UserControl A from UserControl B. I figured that doing x.Visible from UserControl B would be good enough. As it turns out, it was displaying false in the debugger even though I set it explicitly to true and it was never changed. Then I read on MSDN for Control.Visible that:

Even if Visible is set to true, the control might not be visible to the user if it is obscured behind other controls.

So much to my surprise, that will not work. Now I’m wondering how I can tell if the control x is visible from a different UserControl. I would like to avoid using a boolean if possible. Has anyone run into this and found a solution?

Note: It also appears that Control.IsAccessible is false in this situation.

  • 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-22T01:43:38+00:00Added an answer on May 22, 2026 at 1:43 am

    Unfortunately the control doesn’t provide anything public that will allow you to check this.

    One possibility would be to set something in the controls ‘Tag’ property. The tag’s purpose is to associate user data with the control. So it can be anything not just a boolean.

    Here is the Tag property doc

    If you really want the brute force way, you can use Reflection, basically calling GetState(2):

    public static bool WouldBeVisible(Control ctl) 
    {
          // Returns true if the control would be visible if container is visible
          MethodInfo mi = ctl.GetType().GetMethod("GetState", BindingFlags.Instance | BindingFlags.NonPublic);
          if (mi == null) return ctl.Visible;
          return (bool)(mi.Invoke(ctl, new object[] { 2 }));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form that displays file information in a TabControl, and I'd like
I have a WPF TabControl with two TabItems. Each TabItem contains a ListBox with
I have a page with a tab control and each control has almost 15
I have a Silverlight DataGrid that contains a RowDetailsTemplate. The RowDetailsTemplate contains a TabControl
I have a WinForms TabControl that I am dynamically adding TabPages to at runtime.
I have a custom component, that contains a list of another components. If I
I have a TabControl within a TabControl. I want the outer TabControl to show
I have derived a TabControl with the express purpose of enabling double buffering, except
Say I have a Textbox nested within a TabControl . When the form loads,
I have a Tab Control with multiple Tab Pages. I want to be able

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.