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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:27:35+00:00 2026-06-13T17:27:35+00:00

I’m using C++ Builder XE, and have a problem with the Showing property of

  • 0

I’m using C++ Builder XE, and have a problem with the “Showing” property of a TCheckBox.

I have a TForm (ChannelConfigForm), in which there is a TGroupBox (AlarmsGroupBox), in which there is a TCheckBox (A4_en_Xbox).

Sometimes, I cannot see some of the controls on the form.

According to the help documentation :
“If the Visible properties of a component and all the parents in its parent hierarchy are true, Showing is guaranteed to be true. If one of the parents containing the control has a Visible property value of false, Showing may be either true or false.
Showing is a read-only property.”

To find out what’s happening, I wrote the following function to debug the program :
(note : debugf in this function is simply a debug statement I wrote that works similar to printf, which writes debugging stuff to a form)

void ShowParentTree(TControl *Control)
{
  wchar_t Name[32];
  static int level=0;
  TWinControl *wc;

  level++;
  if (level==1)
    debugf(L"Parents of control \"%s\" (%s) :",
                       Control->Name.c_str(),
                       Control->ClassName().c_str());

  // Display what Control has as parents and if they're visible and showing
  debugf(L"level %d : %s->Visible  = %s",level,
                       Control->Name.c_str(),
                       Control->Visible?L"true":L"false");
  wc=(TWinControl *)Control;
  debugf(L"level %d : %s->Showing  = %s",level,
                       wc->Name.c_str(),
                       wc->Showing?L"true":L"false");

  if (Control->Parent)
    ShowParentTree((TControl *)Control->Parent);

  level--;
}

Sometimes when I show the ChannelConfigForm I get the following :

Parents of control "A4_en_Xbox" (TCheckBox) :
level 1 : A4_en_Xbox->Visible  = true
level 1 : A4_en_Xbox->Showing  = false
level 2 : AlarmsGroupBox->Visible  = true
level 2 : AlarmsGroupBox->Showing  = true
level 3 : ChannelConfigForm->Visible  = true
level 3 : ChannelConfigForm->Showing  = true

which I understand as meaning that the A4_en_Xbox->Showing property is false when I think it should be true.

  • 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-13T17:27:36+00:00Added an answer on June 13, 2026 at 5:27 pm

    Check what A4_en_Xbox->HandleAllocated() returns. Showing will be false if HandleAllocated() returns false. The VCL does not guarantee that a TWinControl-derived component always has an HWND allocated at all times. Sometimes it does free HWNDs internally and recreates them when needed.

    Also, your code has a small logic bug in it. Not all TControl descendants are derived from TWinControl, but your code assumes the input TControl is always a TWinControl descendant. You need to check for that so you can avoid access the Showing property for non-TWinControl controls. You can also do away with the recursion completely, just use a simply loop instead:

    void ShowParentTree(TControl *Control)
    {
        if (!Control)
            return;
    
        int level = 0;
        TWinControl *wc = dynamic_cast<TWinControl*>(Control);
    
        debugf(L"Parents of control \"%s\" (%s) :",
                             Control->Name.c_str(),
                             Control->ClassName().c_str());
    
        // Display what Control has as parents and if they're visible and showing
        do
        {
            level++;
    
            if (wc)
            {
                debugf(L"level %d : %s Visible = %s, Showing = %s, HandleAllocated = %s",
                    level,
                    Control->Name.c_str(),
                    Control->Visible ? L"true" : L"false",
                    wc->Showing ? L"true" : L"false",
                    wc->HandleAllocated() ? L"true" : L"false");
    
            }
            else
            {
                debugf(L"level %d : %s Visible = %s",
                    level,
                    Control->Name.c_str(),
                    Control->Visible ? L"true" : L"false");
            }
    
            wc = Control->Parent;
            Control = wc;
        }
        while (Control);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have an autohotkey script which looks up a word in a bilingual dictionary
I have an array which has BIG numbers and small numbers in it. I
I have a text area in my form which accepts all possible characters from
I have thousands of HTML files to process using Groovy/Java and I need to
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

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.