Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
ScaleWidth and ScaleHeight seem to have gone in .net. How can I get the dimensions of the client area of an MDI form? I suppose I could iterate through all the docked controls plus the title bar (query how I get that) and subtract their dimensions from the width and height of the form, but that's a bit messy.
Posted
Just use the form's ClientSize property instead.

OK, hadn't seen that, thanks.

 

But it's not really what I wanted. Height - ClientHeight gives the height of borders plus the caption. So that's of some help. But I still have to worry about all the docked controls. I would have liked to get the dimensions of the actual client window, where child forms go. If you look with Spy++ or something similar, this is an actual window, so it must be possible to get its dimensions. I tried as I would have done it in VB 6.0 using FindWindowEx to get the handle of this window, but the value returned was wrong. My next step would be to use GetClientRect.

 

Otherwise I'll just have to iterate through all docked controls to find their widths/heights and subtract those.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...