MDIClient window

rbulph

Well-known member
Joined
Feb 17, 2003
Messages
343
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 thats a bit messy.
 
PlausiblyDamp said:
Just use the forms ClientSize property instead.
OK, hadnt seen that, thanks.

But its not really what I wanted. Height - ClientHeight gives the height of borders plus the caption. So thats 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 Ill just have to iterate through all docked controls to find their widths/heights and subtract those.
 
Back
Top