Jump to content
  • Advertisement
Sign in to follow this  
billconan

[.net] how to get the runtime width and Height of a control

This topic is 4639 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi everyone, i'm wondering how to get the runtime Height and Width of a control like a panel(dock:fill). i've tried the panel.height and panel.width, but they are the same as what i initialized after i maxmized the form.

Share this post


Link to post
Share on other sites
Advertisement
I can't reproduce it here (in .Net 1.1), I created a new Form, dropped a panel on it, and put the following lines in the constructor:

Console.WriteLine(this.panel1.Size.ToString());
this.panel1.Dock = Dockstyle.Fill;
Console.WriteLine(this.panel1.Size.ToString());

The output is:
{Width=336, Height=224}
{Width=960, Height=557}

So it works fine for me.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!