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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:24:15+00:00 2026-05-23T12:24:15+00:00

In my application I have an area in the main window that at any

  • 0

In my application I have an area in the main window that at any time can contain one of several different controls.

This controls are generated at runtime and their contents can vary depending on underlying data, so I do not know beforehand how much space they’ll take up.

What I want to know is: is there a way to determine at runtime how much space a control needs in order not to be “cut off” or need a scroll? ie: how much space does it need to be COMPLETELY visible?

I tried the “DesiredSize” property and it kinda works, but not always: if the control has been used already (it has already a size) it returns it’s last used size rather than the correct one, even if I call “InvalidateMeasure()”.

Any ideas??

  • 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-23T12:24:15+00:00Added an answer on May 23, 2026 at 12:24 pm

    Call Measure on the control. Give it infinite space as the available size for the calculation. Then check the DesiredSize to get the needed width (and/or height).

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

Sidebar

Related Questions

I have an application that has an area that is supposed to behave somewhat
My application's main window is starting to have lots of stuff so I need
I have a wxWidgets/GTK based application that works well - except for one installation
We have one web application (sharepoint) that collects information from disparate sources. We would
The main idea is to try and make an application that would have look-and-feel
In my application I have large area (≈5000x5000pts) and I must allow user to
I have some text area field in my grails application. I got the following
I have an ASP.NET MVC 3 application (in IIS 7.5) with a portable area.
I have a client apllication that run in very restricted area - it has
We are a lead generating company and have developed one application where our customers

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.