rbulph Posted November 3, 2005 Posted November 3, 2005 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. Quote
Administrators PlausiblyDamp Posted November 3, 2005 Administrators Posted November 3, 2005 Just use the form's ClientSize property instead. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
rbulph Posted November 3, 2005 Author Posted November 3, 2005 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.