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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:50:16+00:00 2026-05-27T00:50:16+00:00

I have two related problems that occur in the following situation. I have a

  • 0

I have two related problems that occur in the following situation.

I have a winforms window that contains some panels. In a few of these panels there are a number of (custom) wpf user-controls.

1

if i check .Visible on the elementhost it always returns true. even though I can see that its not visible.

2

if i check .Height it will always give me the same size. even though the control itself shows a variable number of things and changes size acordingly (through Visibility.collaps);

how can I get to the correct values?

edit: code added

Okey Now I’m officialy going crazy.
If I add a few messageboxes in my code to check when and in what order the above code gets executed. When I do this everything works! but as soon as I delete the messageboxes it reverses the effect. Instead of getting bigger when needed it gets smaller en vice versa….
wtf wpf!

private Size bereken_panel(Panel P)
    {
        Size Sz = new Size();
        int tmp_H = 42;
        foreach (Control SC in P.Controls)
        {
            if (SC is SplitContainer)
            {
                if (SC.Visible)
                {
                    tmp_H += SC.Height;
                }
            }
            else if (SC is System.Windows.Forms.Integration.ElementHost)
            {
                if ((SC as System.Windows.Forms.Integration.ElementHost).Child.Visibility == System.Windows.Visibility.Visible)
                {
                    tmp_H += (int)(SC as System.Windows.Forms.Integration.ElementHost).Child.RenderSize.Height;
                }
            }
        }
       // tmp_H = 42 + n_showed * 25;
        if (tmp_H < 65)
        {
            tmp_H = 65;
        }
        Sz.Height = tmp_H;
        Sz.Width = 432;
        return Sz;
    }

so this is after some extra modification
to clarify where the TopLeft point is.

 int p_x_links = panel1.Width / 2 - 436;
        int p_x_rechts = panel1.Width / 2 + 4;
        //links
        p_contact_gegevens.Size = bereken_panel(p_contact_gegevens);
        p_telnrs.Location = new Point(p_x_links, p_contact_gegevens.Size.Height + p_contact_gegevens.Location.Y + 8);
        p_telnrs.Size = bereken_panel(p_telnrs);
        p_bezoekadres.Location = new Point(p_x_links, p_telnrs.Size.Height + p_telnrs.Location.Y + 8);
        p_bezoekadres.Size = bereken_panel(p_bezoekadres);
        //rechts
        p_administratie.Size = bereken_panel(p_administratie);
        p_postadres.Location = new Point(p_x_rechts, p_administratie.Size.Height + p_administratie.Location.Y + 8);
        p_postadres.Size = bereken_panel(p_postadres);
  • 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-27T00:50:17+00:00Added an answer on May 27, 2026 at 12:50 am
    1. Most probabbly the control is overlapped by some other control. Visibility property in this case can be even True.
    2. Try to use ActualWidth instead.

    EDIT

    Sorry, the example is on ActualWidth, but you are asking for Height. Concept is the same btw.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two problems which are related. 1) I have a batch file that
I have two problems that I'm not sure are related: I have two DropDownList
Hi I have two related problems, i created a pop-up box that appears after
I have two somewhat related problems, shown by the following: user=> (if (symbol? 5)
I have two cmake-related problems: first, I can't make it to find the includes
I have two basic interface-related concepts that I need to have a better understanding
I have two related problems (in Perl): Write data to binary files, in the
I have two problems related to my implementation - I need a function which
In Access 2007, I have two tables related such that the (surrogate) PK of
I'm having some problems with the super function in Python. Suppose I have these

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.